summaryrefslogtreecommitdiffstats
path: root/src/network/bearer
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-04-14 23:22:36 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-04-15 03:13:37 (GMT)
commit86b483104fa1e8c1b2bcd255f9b94992d1d1b864 (patch)
treec1a1368a3a22e2e0cbf384f87849d18a2900e40c /src/network/bearer
parent3174684f5364f9c6a4acbc211d85577b3bab6449 (diff)
downloadQt-86b483104fa1e8c1b2bcd255f9b94992d1d1b864.zip
Qt-86b483104fa1e8c1b2bcd255f9b94992d1d1b864.tar.gz
Qt-86b483104fa1e8c1b2bcd255f9b94992d1d1b864.tar.bz2
Remove holes in bearer management data structures.
Diffstat (limited to 'src/network/bearer')
-rw-r--r--src/network/bearer/qnetworkconfigmanager.cpp2
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp16
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.h11
-rw-r--r--src/network/bearer/qnetworkconfiguration_p.h4
-rw-r--r--src/network/bearer/qnetworksession_p.h4
5 files changed, 23 insertions, 14 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp
index 1ba5dab..6c6e28b 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 c665fa2..b4d4c6b 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 dba9d2c..4cb29e9 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 ccbe670..6e146e0 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 a341eaf..1a6159a 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