diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-03-25 00:56:37 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-03-25 05:53:00 (GMT) |
commit | 3ccbfc46ef2647421608522aa38c12958e4ea3c3 (patch) | |
tree | 874721600ffa38985ee99a98b6ce5043eae122a3 /src | |
parent | af5501d2bef7242d3949d639e2bab7e326654bb2 (diff) | |
download | Qt-3ccbfc46ef2647421608522aa38c12958e4ea3c3.zip Qt-3ccbfc46ef2647421608522aa38c12958e4ea3c3.tar.gz Qt-3ccbfc46ef2647421608522aa38c12958e4ea3c3.tar.bz2 |
Compile with QT_NO_NETWORKINTERFACE defined.
Diffstat (limited to 'src')
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager_p.h | 1 | ||||
-rw-r--r-- | src/network/bearer/qnetworkconfiguration_p.h | 1 | ||||
-rw-r--r-- | src/network/bearer/qnetworksession.cpp | 2 | ||||
-rw-r--r-- | src/network/bearer/qnetworksession.h | 2 | ||||
-rw-r--r-- | src/network/bearer/qnetworksession_p.h | 4 | ||||
-rw-r--r-- | src/plugins/bearer/generic/qgenericengine.cpp | 5 | ||||
-rw-r--r-- | src/plugins/bearer/icd/qnetworksession_impl.cpp | 4 | ||||
-rw-r--r-- | src/plugins/bearer/icd/qnetworksession_impl.h | 7 | ||||
-rw-r--r-- | src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp | 2 | ||||
-rw-r--r-- | src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp | 4 | ||||
-rw-r--r-- | src/plugins/bearer/networkmanager/qnetworkmanagerservice.h | 4 | ||||
-rw-r--r-- | src/plugins/bearer/qnetworksession_impl.cpp | 4 | ||||
-rw-r--r-- | src/plugins/bearer/qnetworksession_impl.h | 2 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/qnetworksession_impl.cpp | 10 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/qnetworksession_impl.h | 6 |
15 files changed, 40 insertions, 18 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h index 8ec8152..dba9d2c 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.h +++ b/src/network/bearer/qnetworkconfigmanager_p.h @@ -57,6 +57,7 @@ #include "qnetworkconfiguration_p.h" #include <QtCore/qmutex.h> +#include <QtCore/qset.h> QT_BEGIN_NAMESPACE diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h index 07b472e..ccbe670 100644 --- a/src/network/bearer/qnetworkconfiguration_p.h +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -57,7 +57,6 @@ #include <QtCore/qshareddata.h> #include <QtCore/qmutex.h> -#include <QtNetwork/QNetworkInterface> QT_BEGIN_NAMESPACE diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp index ca21dcd..1bba56f 100644 --- a/src/network/bearer/qnetworksession.cpp +++ b/src/network/bearer/qnetworksession.cpp @@ -370,6 +370,7 @@ QNetworkConfiguration QNetworkSession::configuration() const return d ? d->publicConfig : QNetworkConfiguration(); } +#ifndef QT_NO_NETWORKINTERFACE /*! Returns the network interface that is used by this session. @@ -386,6 +387,7 @@ QNetworkInterface QNetworkSession::interface() const { return d ? d->currentInterface() : QNetworkInterface(); } +#endif /*! Returns true if this session is open. If the number of all open sessions is greater than diff --git a/src/network/bearer/qnetworksession.h b/src/network/bearer/qnetworksession.h index 1f25088..596f527 100644 --- a/src/network/bearer/qnetworksession.h +++ b/src/network/bearer/qnetworksession.h @@ -86,7 +86,9 @@ public: bool isOpen() const; QNetworkConfiguration configuration() const; +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface interface() const; +#endif State state() const; SessionError error() const; diff --git a/src/network/bearer/qnetworksession_p.h b/src/network/bearer/qnetworksession_p.h index 76691b3..a341eaf 100644 --- a/src/network/bearer/qnetworksession_p.h +++ b/src/network/bearer/qnetworksession_p.h @@ -56,8 +56,6 @@ #include "qnetworksession.h" #include "qnetworkconfiguration_p.h" -#include <QNetworkInterface> - QT_BEGIN_NAMESPACE class Q_NETWORK_EXPORT QNetworkSessionPrivate : public QObject @@ -82,7 +80,9 @@ public: //notification hooks to discover future state changes. virtual void syncStateWithInterface() = 0; +#ifndef QT_NO_NETWORKINTERFACE virtual QNetworkInterface currentInterface() const = 0; +#endif virtual QVariant sessionProperty(const QString& key) const = 0; virtual void setSessionProperty(const QString& key, const QVariant& value) = 0; diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp index b2d1b1f..d65025b 100644 --- a/src/plugins/bearer/generic/qgenericengine.cpp +++ b/src/plugins/bearer/generic/qgenericengine.cpp @@ -66,6 +66,7 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_NETWORKINTERFACE static QString qGetInterfaceType(const QString &interface) { #ifdef Q_OS_WIN32 @@ -139,6 +140,7 @@ static QString qGetInterfaceType(const QString &interface) return QLatin1String("Unknown"); } +#endif QGenericEngine::QGenericEngine(QObject *parent) : QBearerEngineImpl(parent) @@ -180,6 +182,7 @@ void QGenericEngine::requestUpdate() void QGenericEngine::doRequestUpdate() { +#ifndef QT_NO_NETWORKINTERFACE QMutexLocker locker(&mutex); // Immediately after connecting with a wireless access point @@ -290,6 +293,8 @@ void QGenericEngine::doRequestUpdate() } locker.unlock(); +#endif + emit updateCompleted(); } diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index 06e0529..5bf95dc 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -1110,7 +1110,7 @@ void QNetworkSessionPrivateImpl::reject() { } - +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const { if (!publicConfig.isValid() || state != QNetworkSession::Connected) @@ -1121,7 +1121,7 @@ QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const return QNetworkInterface::interfaceFromName(currentNetworkInterface); } - +#endif void QNetworkSessionPrivateImpl::setSessionProperty(const QString& key, const QVariant& value) { diff --git a/src/plugins/bearer/icd/qnetworksession_impl.h b/src/plugins/bearer/icd/qnetworksession_impl.h index 587e6dc..c02faac 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.h +++ b/src/plugins/bearer/icd/qnetworksession_impl.h @@ -56,11 +56,6 @@ #include <QtNetwork/private/qnetworksession_p.h> #include <QtNetwork/qnetworkconfigmanager.h> -//#include "qnetworkconfigmanager_maemo_p.h" -//#include "qnetworksession.h" - -//#include <qnetworksession.h> -//#include <QNetworkInterface> #include <QtCore/qdatetime.h> #include <icd/dbus_api.h> @@ -90,7 +85,9 @@ public: //notification hooks to discover future state changes. void syncStateWithInterface(); +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface currentInterface() const; +#endif QVariant sessionProperty(const QString& key) const; void setSessionProperty(const QString& key, const QVariant& value); diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index 2b2df07..28ee38e 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -151,7 +151,7 @@ QString QNetworkManagerEngine::getInterfaceFromId(const QString &id) continue; QNetworkManagerInterfaceDevice device(devices.at(0).path()); - return device.networkInterface().name(); + return device.networkInterface(); } } diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp index d23bb0d..a20370b 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp @@ -353,9 +353,9 @@ QString QNetworkManagerInterfaceDevice::udi() const return d->connectionInterface->property("Udi").toString(); } -QNetworkInterface QNetworkManagerInterfaceDevice::networkInterface() const +QString QNetworkManagerInterfaceDevice::networkInterface() const { - return QNetworkInterface::interfaceFromName(d->connectionInterface->property("Interface").toString()); + return d->connectionInterface->property("Interface").toString(); } quint32 QNetworkManagerInterfaceDevice::ip4Address() const diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h index ecca537..95f5b4a 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h @@ -59,8 +59,6 @@ #include <QtDBus/QDBusInterface> #include <QtDBus/QDBusMessage> #include <QtDBus/QDBusReply> -#include <QNetworkInterface> - #include <QtDBus/QDBusPendingCallWatcher> #include <QtDBus/QDBusObjectPath> @@ -252,7 +250,7 @@ public: ~QNetworkManagerInterfaceDevice(); QString udi() const; - QNetworkInterface networkInterface() const; + QString networkInterface() const; QDBusInterface *connectionInterface() const; quint32 ip4Address() const; quint32 state() const; diff --git a/src/plugins/bearer/qnetworksession_impl.cpp b/src/plugins/bearer/qnetworksession_impl.cpp index db1759c..33cce69 100644 --- a/src/plugins/bearer/qnetworksession_impl.cpp +++ b/src/plugins/bearer/qnetworksession_impl.cpp @@ -49,8 +49,6 @@ #include <QtCore/qdebug.h> #include <QtCore/qmutex.h> -#include <QtNetwork/qnetworkinterface.h> - QT_BEGIN_NAMESPACE static QBearerEngineImpl *getEngineFromId(const QString &id) @@ -218,6 +216,7 @@ void QNetworkSessionPrivateImpl::reject() { } +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const { if (!publicConfig.isValid() || !engine || state != QNetworkSession::Connected) @@ -229,6 +228,7 @@ QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const return QNetworkInterface(); return QNetworkInterface::interfaceFromName(interface); } +#endif QVariant QNetworkSessionPrivateImpl::sessionProperty(const QString &key) const { diff --git a/src/plugins/bearer/qnetworksession_impl.h b/src/plugins/bearer/qnetworksession_impl.h index c644174..3becbf0 100644 --- a/src/plugins/bearer/qnetworksession_impl.h +++ b/src/plugins/bearer/qnetworksession_impl.h @@ -83,7 +83,9 @@ public: //notification hooks to discover future state changes. void syncStateWithInterface(); +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface currentInterface() const; +#endif QVariant sessionProperty(const QString& key) const; void setSessionProperty(const QString& key, const QVariant& value); diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 8910efe..512ea51 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -152,6 +152,7 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface() } } +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface QNetworkSessionPrivateImpl::interface(TUint iapId) const { QString interfaceName; @@ -189,7 +190,9 @@ QNetworkInterface QNetworkSessionPrivateImpl::interface(TUint iapId) const return QNetworkInterface::interfaceFromName(interfaceName); } +#endif +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const { if (!publicConfig.isValid() || state != QNetworkSession::Connected) { @@ -198,6 +201,7 @@ QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const return activeInterface; } +#endif QVariant QNetworkSessionPrivateImpl::sessionProperty(const QString& /*key*/) const { @@ -309,7 +313,9 @@ void QNetworkSessionPrivateImpl::open() if (connInfo().iIapId == symbianConfig->numericId) { if (iConnection.Attach(connInfo, RConnection::EAttachTypeNormal) == KErrNone) { activeConfig = publicConfig; +#ifndef QT_NO_NETWORKINTERFACE activeInterface = interface(symbianConfig->numericId); +#endif connected = ETrue; startTime = QDateTime::currentDateTime(); if (iDynamicSetdefaultif) { @@ -878,7 +884,9 @@ void QNetworkSessionPrivateImpl::RunL() toSymbianConfig(privateConfiguration(activeConfig)); symbianConfig->mutex.lock(); +#ifndef QT_NO_NETWORKINTERFACE activeInterface = interface(symbianConfig->numericId); +#endif if (publicConfig.type() == QNetworkConfiguration::UserChoice) { serviceConfig = QNetworkConfigurationManager() .configurationFromIdentifier(symbianConfig->serviceNetworkPtr->id); @@ -936,9 +944,11 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint SymbianNetworkConfigurationPrivate *symbianConfig = toSymbianConfig(privateConfiguration(activeConfig)); +#ifndef QT_NO_NETWORKINTERFACE symbianConfig->mutex.lock(); activeInterface = interface(symbianConfig->numericId); symbianConfig->mutex.unlock(); +#endif #ifdef SNAP_FUNCTIONALITY_AVAILABLE if (iDynamicSetdefaultif) { diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h index 35e2c58..9a57eae 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.h +++ b/src/plugins/bearer/symbian/qnetworksession_impl.h @@ -89,7 +89,9 @@ public: //notification hooks to discover future state changes. void syncStateWithInterface(); +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface currentInterface() const; +#endif QVariant sessionProperty(const QString& key) const; void setSessionProperty(const QString& key, const QVariant& value); @@ -137,12 +139,16 @@ private: void handleSymbianConnectionStatusChange(TInt aConnectionStatus, TInt aError, TUint accessPointId = 0); QNetworkConfiguration bestConfigFromSNAP(const QNetworkConfiguration& snapConfig) const; QNetworkConfiguration activeConfiguration(TUint32 iapId = 0) const; +#ifndef QT_NO_NETWORKINTERFACE QNetworkInterface interface(TUint iapId) const; +#endif private: // data SymbianEngine *engine; +#ifndef QT_NO_NETWORKINTERFACE mutable QNetworkInterface activeInterface; +#endif QDateTime startTime; |