From 313392ec6b5c53b8f3fcb0866dc0f5b045e3a557 Mon Sep 17 00:00:00 2001 From: Jari Helaakoski Date: Mon, 27 May 2024 13:14:46 +0300 Subject: [PATCH] Fix compilation issues when configuration features are disabled Commit fixes settings and http features Task-number: QTBUG-122999 Change-Id: Iff94e9e4f7122a35000376e59cdea2a93e6a7f40 Reviewed-by: Fabian Kosmale (cherry picked from commit ba672abfaed6fa8adde44b32c7f43c91630b5eeb) --- src/corelib/global/qlibraryinfo.cpp | 23 +++++++++---------- tests/auto/corelib/global/CMakeLists.txt | 4 +++- .../qnetworkrequest/tst_qnetworkrequest.cpp | 2 ++ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 6ffaef8f7c9..e09d2c72e1f 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -537,7 +537,18 @@ QStringList QLibraryInfo::paths(LibraryPath p) return QLibraryInfoPrivate::paths(p); } +static bool keepQtBuildDefaults() +{ +#if QT_CONFIG(settings) + QSettings *config = QLibraryInfoPrivate::configuration(); + Q_ASSERT(config != nullptr); + return config->value("Config/MergeQtConf", false).toBool(); +#else + return false; +#endif +} +#if QT_CONFIG(settings) static QString normalizePath(QString ret) { qsizetype startIndex = 0; @@ -566,18 +577,6 @@ static QString normalizePath(QString ret) return QDir::fromNativeSeparators(ret); }; -static bool keepQtBuildDefaults() -{ -#if QT_CONFIG(settings) - QSettings *config = QLibraryInfoPrivate::configuration(); - Q_ASSERT(config != nullptr); - return config->value("Config/MergeQtConf", false).toBool(); -#else - return false; -#endif -} - -#if QT_CONFIG(settings) static QVariant libraryPathToValue(QLibraryInfo::LibraryPath loc) { QVariant value; diff --git a/tests/auto/corelib/global/CMakeLists.txt b/tests/auto/corelib/global/CMakeLists.txt index 6072a18e817..8adf9d74306 100644 --- a/tests/auto/corelib/global/CMakeLists.txt +++ b/tests/auto/corelib/global/CMakeLists.txt @@ -16,7 +16,9 @@ if(NOT INTEGRITY) add_subdirectory(qnativeinterface) endif() add_subdirectory(qrandomgenerator) -add_subdirectory(qlibraryinfo) +if (QT_FEATURE_settings) + add_subdirectory(qlibraryinfo) +endif() add_subdirectory(qlogging) add_subdirectory(qtendian) add_subdirectory(qglobalstatic) diff --git a/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp b/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp index 0b6d6f339be..f0b02ae91d3 100644 --- a/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp +++ b/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp @@ -3,8 +3,10 @@ #include +#if QT_CONFIG(http) #include #include +#endif #include #include