From e60a50286c6e56291554318256044ff486d944a0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 27 Jan 2023 11:46:12 +0100 Subject: [PATCH] QtNetwork: Disambiguate static variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They causes clashes in CMake Unity (Jumbo) builds. Task-number: QTBUG-109394 Change-Id: Ifd0539c3b56dc395a860de927736f60ad766224a Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 25537f5fdc9a19e54ad639bdec80e8a1b5805fdd) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qnetworkaccessmanager.cpp | 8 ++++---- src/network/kernel/qnetworkinformation.cpp | 8 ++++---- src/network/ssl/qtlsbackend.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 2e3a3d81f19..e6fea590bd8 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -77,7 +77,7 @@ Q_APPLICATION_STATIC(QNetworkAccessFileBackendFactory, fileBackend) Q_GLOBAL_STATIC(QNetworkAccessDebugPipeBackendFactory, debugpipeBackend) #endif -Q_APPLICATION_STATIC(QFactoryLoader, loader, QNetworkAccessBackendFactory_iid, "/networkaccess"_L1) +Q_APPLICATION_STATIC(QFactoryLoader, qnabfLoader, QNetworkAccessBackendFactory_iid, "/networkaccess"_L1) #if defined(Q_OS_MACOS) bool getProxyAuth(const QString& proxyHostname, const QString &scheme, QString& username, QString& password) @@ -1703,13 +1703,13 @@ void QNetworkAccessManagerPrivate::ensureBackendPluginsLoaded() { Q_CONSTINIT static QBasicMutex mutex; std::unique_lock locker(mutex); - if (!loader()) + if (!qnabfLoader()) return; #if QT_CONFIG(library) - loader->update(); + qnabfLoader->update(); #endif int index = 0; - while (loader->instance(index)) + while (qnabfLoader->instance(index)) ++index; } diff --git a/src/network/kernel/qnetworkinformation.cpp b/src/network/kernel/qnetworkinformation.cpp index 16d8e4d0409..fc40787067a 100644 --- a/src/network/kernel/qnetworkinformation.cpp +++ b/src/network/kernel/qnetworkinformation.cpp @@ -26,7 +26,7 @@ struct QNetworkInformationDeleter void operator()(QNetworkInformation *information) { delete information; } }; -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, +Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, qniLoader, (QNetworkInformationBackendFactory_iid, QStringLiteral("/networkinformation"))) @@ -84,7 +84,7 @@ private: bool QNetworkInformationPrivate::initializeList() { - if (!loader()) + if (!qniLoader()) return false; if (!dataHolder()) return false; @@ -92,11 +92,11 @@ bool QNetworkInformationPrivate::initializeList() QMutexLocker initLocker(&mutex); #if QT_CONFIG(library) - loader->update(); + qniLoader->update(); #endif // Instantiates the plugins (and registers the factories) int index = 0; - while (loader->instance(index)) + while (qniLoader->instance(index)) ++index; initLocker.unlock(); diff --git a/src/network/ssl/qtlsbackend.cpp b/src/network/ssl/qtlsbackend.cpp index d1157e5838e..8ef82a8a8e2 100644 --- a/src/network/ssl/qtlsbackend.cpp +++ b/src/network/ssl/qtlsbackend.cpp @@ -27,7 +27,7 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; -Q_APPLICATION_STATIC(QFactoryLoader, loader, QTlsBackend_iid, +Q_APPLICATION_STATIC(QFactoryLoader, qtlsbLoader, QTlsBackend_iid, QStringLiteral("/tls")) namespace { @@ -54,7 +54,7 @@ public: bool tryPopulateCollection() { - if (!loader()) + if (!qtlsbLoader()) return false; Q_CONSTINIT static QBasicMutex mutex; @@ -63,10 +63,10 @@ public: return true; #if QT_CONFIG(library) - loader->update(); + qtlsbLoader->update(); #endif int index = 0; - while (loader->instance(index)) + while (qtlsbLoader->instance(index)) ++index; return true;