summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-05-31 14:04:19 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-06-13 11:37:50 (GMT)
commitefba403423db53ed480bd88be4dcd650f8ae831a (patch)
treedd10c314f81223f16cd48a254bcee2840118dab2 /src/network
parent5bb3af94428d85c9d08b3c4cfb31c4071604b06d (diff)
downloadQt-efba403423db53ed480bd88be4dcd650f8ae831a.zip
Qt-efba403423db53ed480bd88be4dcd650f8ae831a.tar.gz
Qt-efba403423db53ed480bd88be4dcd650f8ae831a.tar.bz2
Revert "Revert "Fix QNetworkConfigurationManager usage outside main thread first""
This reverts commit daba0c0d588c55e3f1591ab8ce0ef0946d1447fd.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 7297b0e..2391a34 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -392,8 +392,6 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)),
this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)));
-
- QMetaObject::invokeMethod(engine, "initialize");
}
}
@@ -423,8 +421,19 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
startPolling();
}
- if (firstUpdate)
+ if (firstUpdate) {
firstUpdate = false;
+ QList<QBearerEngine*> enginesToInitialize = sessionEngines; //shallow copy the list in case it is modified when we unlock mutex
+ Qt::ConnectionType connectionType;
+ if (QCoreApplicationPrivate::mainThread() == QThread::currentThread())
+ connectionType = Qt::DirectConnection;
+ else
+ connectionType = Qt::BlockingQueuedConnection;
+ locker.unlock();
+ foreach (QBearerEngine* engine, enginesToInitialize) {
+ QMetaObject::invokeMethod(engine, "initialize", connectionType);
+ }
+ }
}
void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate()