summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-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