diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-11-10 09:18:11 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-11-11 14:30:00 +0000 |
commit | e6db4206b81f3fcea13646461f56a5207d9608c2 (patch) | |
tree | d0db823fb8956a073a029b7eac1180f3f6d4121e /src/corelib/global | |
parent | f9e6ee655f463e7175e3bf07cdac0946e8141cb3 (diff) |
Fix not respected qt.conf settings
Change 6fb569af951 introduces reloadOnQAppAvailable for
QLibrarySettings, however it is missing a reload check
for hasPaths, this breaks essentially reading custom qt.conf
Add missing check.
Fixes: QTBUG-97382
Fixes: QTBUG-97383
Fixes: QTBUG-97947
Pick-to: 6.2
Change-Id: I28379d9dd38357c290edd44b93d3bea489b9cefe
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index e399369d74..3a515cb9ba 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -78,16 +78,16 @@ struct QLibrarySettings { QLibrarySettings(); void load(); + bool havePaths(); QSettings *configuration(); QScopedPointer<QSettings> settings; - bool havePaths; + bool paths; bool reloadOnQAppAvailable; }; Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings) -QLibrarySettings::QLibrarySettings() : havePaths(false) - , reloadOnQAppAvailable(false) +QLibrarySettings::QLibrarySettings() : paths(false), reloadOnQAppAvailable(false) { load(); } @@ -99,6 +99,13 @@ QSettings *QLibrarySettings::configuration() return settings.data(); } +bool QLibrarySettings::havePaths() +{ + if (reloadOnQAppAvailable && QCoreApplication::instance() != nullptr) + load(); + return paths; +} + void QLibrarySettings::load() { // If we get any settings here, those won't change when the application shows up. @@ -109,8 +116,8 @@ void QLibrarySettings::load() // This code needs to be in the regular library, as otherwise a qt.conf that // works for qmake would break things for dynamically built Qt tools. QStringList children = settings->childGroups(); - havePaths = !children.contains(QLatin1String("Platforms")) - || children.contains(QLatin1String("Paths")); + paths = !children.contains(QLatin1String("Platforms")) + || children.contains(QLatin1String("Paths")); } } @@ -165,7 +172,7 @@ void QLibraryInfoPrivate::reload() static bool havePaths() { QLibrarySettings *ls = qt_library_settings(); - return ls && ls->havePaths; + return ls && ls->havePaths(); } #endif // settings |