summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2023-05-12 08:36:45 -0700
committerThiago Macieira <thiago.macieira@intel.com>2023-05-14 12:47:01 -0700
commit0fc0e821f129d064cc1ce92ad71669ffaf005ca2 (patch)
treedbc2f453788dc049e6c85f37faa6bf089acba760 /src
parent471f134cdd705f6a3909928f4d9d3703657a5170 (diff)
QDnsLookup: remove the #if QT_CONFIG(thread) check
There's no fallback anywhere, so this class simply doesn't work if threading isn't supported. Writing it is an exercise left for whoever cares for that configuration. Change-Id: I3e3bfef633af4130a03afffd175e6f68a3f4673f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/network/configure.cmake2
-rw-r--r--src/network/kernel/qdnslookup.cpp9
-rw-r--r--src/network/kernel/qdnslookup_p.h2
3 files changed, 3 insertions, 10 deletions
diff --git a/src/network/configure.cmake b/src/network/configure.cmake
index 0fd3a103b2..a26f979d3c 100644
--- a/src/network/configure.cmake
+++ b/src/network/configure.cmake
@@ -331,7 +331,7 @@ qt_feature("dnslookup" PUBLIC
SECTION "Networking"
LABEL "QDnsLookup"
PURPOSE "Provides API for DNS lookups."
- CONDITION NOT INTEGRITY
+ CONDITION QT_FEATURE_thread AND NOT INTEGRITY
)
qt_feature("gssapi" PUBLIC
SECTION "Networking"
diff --git a/src/network/kernel/qdnslookup.cpp b/src/network/kernel/qdnslookup.cpp
index 3ad19b0660..29f0c4928a 100644
--- a/src/network/kernel/qdnslookup.cpp
+++ b/src/network/kernel/qdnslookup.cpp
@@ -13,9 +13,7 @@
QT_BEGIN_NAMESPACE
-#if QT_CONFIG(thread)
Q_GLOBAL_STATIC(QDnsLookupThreadPool, theDnsLookupThreadPool);
-#endif
static bool qt_qdnsmailexchangerecord_less_than(const QDnsMailExchangeRecord &r1, const QDnsMailExchangeRecord &r2)
{
@@ -476,9 +474,7 @@ void QDnsLookup::lookup()
connect(d->runnable, &QDnsLookupRunnable::finished,
this, [this](const QDnsLookupReply &reply) { d_func()->_q_lookupFinished(reply); },
Qt::BlockingQueuedConnection);
-#if QT_CONFIG(thread)
- theDnsLookupThreadPool()->start(d->runnable);
-#endif
+ theDnsLookupThreadPool->start(d->runnable);
}
/*!
@@ -991,7 +987,6 @@ void QDnsLookupRunnable::run()
emit finished(reply);
}
-#if QT_CONFIG(thread)
QDnsLookupThreadPool::QDnsLookupThreadPool()
: signalsConnected(false)
{
@@ -1027,7 +1022,7 @@ void QDnsLookupThreadPool::_q_applicationDestroyed()
waitForDone();
signalsConnected = false;
}
-#endif // QT_CONFIG(thread)
+
QT_END_NAMESPACE
#include "moc_qdnslookup.cpp"
diff --git a/src/network/kernel/qdnslookup_p.h b/src/network/kernel/qdnslookup_p.h
index 3a8e1a53cb..c1082863cd 100644
--- a/src/network/kernel/qdnslookup_p.h
+++ b/src/network/kernel/qdnslookup_p.h
@@ -117,7 +117,6 @@ private:
QHostAddress nameserver;
};
-#if QT_CONFIG(thread)
class QDnsLookupThreadPool : public QThreadPool
{
Q_OBJECT
@@ -133,7 +132,6 @@ private:
QMutex signalsMutex;
bool signalsConnected;
};
-#endif // QT_CONFIG(thread)
class QDnsRecordPrivate : public QSharedData
{