summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlibraryinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qlibraryinfo.cpp')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp19
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