diff options
-rw-r--r-- | src/network/kernel/qhostinfo.cpp | 5 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo_p.h | 8 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index b9e386b526..0dbb2cefb1 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -907,9 +907,10 @@ void QHostInfoRunnable::run() QHostInfoLookupManager::QHostInfoLookupManager() : wasDeleted(false) { - moveToThread(QCoreApplicationPrivate::mainThread()); #if QT_CONFIG(thread) - connect(QCoreApplication::instance(), SIGNAL(destroyed()), SLOT(waitForThreadPoolDone()), Qt::DirectConnection); + QObject::connect(QCoreApplication::instance(), &QObject::destroyed, + &threadPool, [&](QObject *) { threadPool.waitForDone(); }, + Qt::DirectConnection); threadPool.setMaxThreadCount(20); // do up to 20 DNS lookups in parallel #endif } diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index 747069a2c6..ee052b86d3 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -208,9 +208,8 @@ public: }; -class QHostInfoLookupManager : public QObject +class QHostInfoLookupManager { - Q_OBJECT public: QHostInfoLookupManager(); ~QHostInfoLookupManager(); @@ -246,11 +245,6 @@ protected: private: void rescheduleWithMutexHeld(); - -private slots: -#if QT_CONFIG(thread) - void waitForThreadPoolDone() { threadPool.waitForDone(); } -#endif }; QT_END_NAMESPACE |