diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-15 06:06:14 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-15 06:06:14 (GMT) |
commit | 414ff1be28af440f1e01a38e497227f3849e8e54 (patch) | |
tree | c4f0d6d280880b5dce165421b6a48567c86f9288 /src/network | |
parent | 6ce4e6247fa6e438a34a498cd803a5542ff338b7 (diff) | |
parent | 904494979d2292ca2be702467ff6e288106444d5 (diff) | |
download | Qt-414ff1be28af440f1e01a38e497227f3849e8e54.zip Qt-414ff1be28af440f1e01a38e497227f3849e8e54.tar.gz Qt-414ff1be28af440f1e01a38e497227f3849e8e54.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (24 commits)
Fix MOBILITY-404
Remove holes in bearer management data structures.
Don't link bearer plugins against QtGui unnecessarily.
Added missing newline after warning message when using -L with qml
Doc: updating scripts
Fixed a crash on embedded due to uninitialized pointer.
Fix a race where QThread::exit() is "lost" when called after start()
qdoc: Removed all <table> attributes in favor of using css.
Autotest failure: dialogModality test fails on cocoa (macgui)
Force the bic test to compile in 32-bit mode on Mac
Revert "Doc: Updating design files."
Remove statically allocated pixmaps through the post routine
qdoc: Checked for empty title.
qdoc: Added TOC to class ref pages.
Cocoa: qwidget autotest fails on setToolTip
Compile on Mac OS 10.4
Bearer management changes from Qt Mobility (7a5ff985)
Partially revert "Sunstudio12.1(5.10): Fix compile errors GTK style and other minor compile errors"
Fix margins for placeholdertext in QLineEdit
qdoc: Added TOC to module pages.
...
Diffstat (limited to 'src/network')
-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.cpp | 4 | ||||
-rw-r--r-- | src/network/bearer/qnetworksession_p.h | 4 |
6 files changed, 27 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.cpp b/src/network/bearer/qnetworksession.cpp index 1bba56f..638bee7 100644 --- a/src/network/bearer/qnetworksession.cpp +++ b/src/network/bearer/qnetworksession.cpp @@ -225,6 +225,10 @@ QT_BEGIN_NAMESPACE QNetworkSession::QNetworkSession(const QNetworkConfiguration& connectionConfig, QObject* parent) : QObject(parent), d(0) { + // invalid configuration + if (connectionConfig.identifier().isNull()) + return; + foreach (QBearerEngine *engine, qNetworkConfigurationManagerPrivate()->engines()) { if (engine->hasIdentifier(connectionConfig.identifier())) { d = engine->createSessionBackend(); 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 |