summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormae <matthias.ettrich@nokia.com>2012-03-01 19:42:50 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-02 23:16:25 +0100
commit0f4913702702420cc4f849fd83296bee777fab26 (patch)
tree30a6de815e1b5e30c024f0313f9f668c95306bac /src
parent9c757fac3540f12b066dcecc936714bcd119f155 (diff)
Name threads properly
When there is no QObject subclass with Q_OBJECT macro, we must at least set an object name Change-Id: Ib429a9b246d9d6b4b4cfb11593e4f358850677f2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp2
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index a4413cda95..2124395de3 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -607,12 +607,14 @@ void QNetworkReplyHttpImplPrivate::postRequest()
if (synchronous) {
// A synchronous HTTP request uses its own thread
thread = new QThread();
+ thread->setObjectName(QStringLiteral("httpReply"));
QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
thread->start();
} else if (!managerPrivate->httpThread) {
// We use the manager-global thread.
// At some point we could switch to having multiple threads if it makes sense.
managerPrivate->httpThread = new QThread();
+ managerPrivate->httpThread->setObjectName(QStringLiteral("httpThread"));
QObject::connect(managerPrivate->httpThread, SIGNAL(finished()), managerPrivate->httpThread, SLOT(deleteLater()));
managerPrivate->httpThread->start();
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 25bf21e7b9..d152adca92 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -70,6 +70,8 @@ void QNetworkConfigurationManagerPrivate::initialize()
{
//Two stage construction, because we only want to do this heavyweight work for the winner of the Q_GLOBAL_STATIC race.
bearerThread = new QThread();
+ bearerThread->setObjectName(QStringLiteral("bearerThread"));
+
bearerThread->moveToThread(QCoreApplicationPrivate::mainThread()); // because cleanup() is called in main thread context.
moveToThread(bearerThread);
bearerThread->start();