Fix not respected qt.conf settings
Change 6fb569af95 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>
bb10
parent
f9e6ee655f
commit
e6db4206b8
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue