diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-04-15 09:22:36 +1000 |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-04-15 13:13:37 +1000 |
commit | 86b483104fa1e8c1b2bcd255f9b94992d1d1b864 (patch) | |
tree | c1a1368a3a22e2e0cbf384f87849d18a2900e40c | |
parent | 3174684f5364f9c6a4acbc211d85577b3bab6449 (diff) | |
download | qt4-tools-86b483104fa1e8c1b2bcd255f9b94992d1d1b864.tar.gz |
Remove holes in bearer management data structures.
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager.cpp | 2 | ||||
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager_p.cpp | 16 | ||||
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager_p.h | 11 | ||||
-rw-r--r-- | src/network/bearer/qnetworkconfiguration_p.h | 4 | ||||
-rw-r--r-- | src/network/bearer/qnetworksession_p.h | 4 | ||||
-rw-r--r-- | src/plugins/bearer/icd/qicdengine.h | 8 | ||||
-rw-r--r-- | src/plugins/bearer/qnetworksession_impl.h | 8 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/symbianengine.h | 8 |
8 files changed, 35 insertions, 26 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp index 1ba5dab30f..6c6e28b800 100644 --- a/src/network/bearer/qnetworkconfigmanager.cpp +++ b/src/network/bearer/qnetworkconfigmanager.cpp @@ -278,7 +278,7 @@ bool QNetworkConfigurationManager::isOnline() const */ QNetworkConfigurationManager::Capabilities QNetworkConfigurationManager::capabilities() const { - return connManager()->capFlags; + return connManager()->capabilities(); } /*! diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index c665fa257b..b4d4c6b0da 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -56,7 +56,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QBearerEngineFactoryInterface_iid, QLatin1String("/bearer"))) QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate() -: capFlags(0), mutex(QMutex::Recursive), pollTimer(0), forcedPolling(0), firstUpdate(true) +: pollTimer(0), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true) { qRegisterMetaType<QNetworkConfiguration>("QNetworkConfiguration"); @@ -265,6 +265,18 @@ bool QNetworkConfigurationManagerPrivate::isOnline() return !onlineConfigurations.isEmpty(); } +QNetworkConfigurationManager::Capabilities QNetworkConfigurationManagerPrivate::capabilities() +{ + QMutexLocker locker(&mutex); + + QNetworkConfigurationManager::Capabilities capFlags; + + foreach (QBearerEngine *engine, sessionEngines) + capFlags |= engine->capabilities(); + + return capFlags; +} + void QNetworkConfigurationManagerPrivate::configurationAdded(QNetworkConfigurationPrivatePointer ptr) { QMutexLocker locker(&mutex); @@ -367,8 +379,6 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)), this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer))); - capFlags |= engine->capabilities(); - QMetaObject::invokeMethod(engine, "requestUpdate"); } } diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h index dba9d2c389..4cb29e90cb 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.h +++ b/src/network/bearer/qnetworkconfigmanager_p.h @@ -78,7 +78,7 @@ public: bool isOnline(); - QNetworkConfigurationManager::Capabilities capFlags; + QNetworkConfigurationManager::Capabilities capabilities(); void performAsyncConfigurationUpdate(); @@ -102,19 +102,18 @@ Q_SIGNALS: void abort(); private: - QMutex mutex; - QTimer *pollTimer; + QMutex mutex; + QList<QBearerEngine *> sessionEngines; QSet<QString> onlineConfigurations; - QSet<int> updatingEngines; - bool updating; - QSet<int> pollingEngines; + QSet<int> updatingEngines; int forcedPolling; + bool updating; bool firstUpdate; diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h index ccbe67050d..6e146e06a6 100644 --- a/src/network/bearer/qnetworkconfiguration_p.h +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -84,6 +84,8 @@ public: return bearer; } + QList<QNetworkConfigurationPrivatePointer> serviceNetworkMembers; + mutable QMutex mutex; QString bearer; @@ -94,8 +96,6 @@ public: QNetworkConfiguration::Type type; QNetworkConfiguration::Purpose purpose; - QList<QNetworkConfigurationPrivatePointer> serviceNetworkMembers; - bool isValid; bool roamingSupported; diff --git a/src/network/bearer/qnetworksession_p.h b/src/network/bearer/qnetworksession_p.h index a341eaf783..1a6159ae9a 100644 --- a/src/network/bearer/qnetworksession_p.h +++ b/src/network/bearer/qnetworksession_p.h @@ -126,6 +126,8 @@ Q_SIGNALS: void preferredConfigurationChanged(const QNetworkConfiguration &config, bool isSeamless); protected: + QNetworkSession *q; + // The config set on QNetworkSession. QNetworkConfiguration publicConfig; @@ -140,8 +142,6 @@ protected: QNetworkSession::State state; bool isOpen; - - QNetworkSession *q; }; QT_END_NAMESPACE diff --git a/src/plugins/bearer/icd/qicdengine.h b/src/plugins/bearer/icd/qicdengine.h index a2e9a2f05e..841874fb10 100644 --- a/src/plugins/bearer/icd/qicdengine.h +++ b/src/plugins/bearer/icd/qicdengine.h @@ -67,13 +67,13 @@ public: QByteArray network_id; // typically WLAN ssid or similar QString iap_type; // is this one WLAN or GPRS - // Network attributes for this IAP, this is the value returned by icd and - // passed to it when connecting. - uint32_t network_attrs; - QString service_type; QString service_id; uint32_t service_attrs; + + // Network attributes for this IAP, this is the value returned by icd and + // passed to it when connecting. + uint32_t network_attrs; }; inline IcdNetworkConfigurationPrivate *toIcdConfig(QNetworkConfigurationPrivatePointer ptr) diff --git a/src/plugins/bearer/qnetworksession_impl.h b/src/plugins/bearer/qnetworksession_impl.h index 3becbf066a..acf1ccec51 100644 --- a/src/plugins/bearer/qnetworksession_impl.h +++ b/src/plugins/bearer/qnetworksession_impl.h @@ -116,15 +116,15 @@ private Q_SLOTS: void decrementTimeout(); private: - bool opened; - QBearerEngineImpl *engine; - QNetworkSession::SessionError lastError; - quint64 startTime; + QNetworkSession::SessionError lastError; + int sessionTimeout; + + bool opened; }; QT_END_NAMESPACE diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h index 2e7ae6079b..dfd12bd403 100644 --- a/src/plugins/bearer/symbian/symbianengine.h +++ b/src/plugins/bearer/symbian/symbianengine.h @@ -84,14 +84,14 @@ public: QString bearerName() const; + QNetworkConfigurationPrivatePointer serviceNetworkPtr; + + QString mappingName; + Bearer bearer; TUint32 numericId; TUint connectionId; - - QNetworkConfigurationPrivatePointer serviceNetworkPtr; - - QString mappingName; }; inline SymbianNetworkConfigurationPrivate *toSymbianConfig(QNetworkConfigurationPrivatePointer ptr) |