If available, use a version-specific qt<major-version>.conf
To enable the current Qt version to use a qt.conf that is independent from the previous version, a file named 'qt<major-version>.conf' is searched for first. If this file does not exist, a file with the name 'qt.conf' is searched for. Task-number: QTBUG-88635 Change-Id: If75b63f72a7bdbdf1de7729ea4ecb00810b58d12 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
parent
4d3d981144
commit
ab2c61e638
@ -174,7 +174,7 @@ bool usage(const char *a0)
|
||||
" -set <prop> <value> Set persistent property\n"
|
||||
" -unset <prop> Unset persistent property\n"
|
||||
" -query <prop> Query persistent property. Show all if <prop> is empty.\n"
|
||||
" -qtconf file Use file instead of looking for qt.conf\n"
|
||||
" -qtconf file Use file instead of looking for qt" QT_STRINGIFY(QT_VERSION_MAJOR) ".conf, then qt.conf\n"
|
||||
" -cache file Use file as cache [makefile mode only]\n"
|
||||
" -spec spec Use spec as QMAKESPEC [makefile mode only]\n"
|
||||
" -nocache Don't use a cache file [makefile mode only]\n"
|
||||
@ -660,8 +660,15 @@ QString qmake_libraryInfoFile()
|
||||
{
|
||||
if (!Option::globals->qtconf.isEmpty())
|
||||
return Option::globals->qtconf;
|
||||
if (!Option::globals->qmake_abslocation.isEmpty())
|
||||
return QDir(QFileInfo(Option::globals->qmake_abslocation).absolutePath()).filePath("qt.conf");
|
||||
if (!Option::globals->qmake_abslocation.isEmpty()) {
|
||||
QDir dir(QFileInfo(Option::globals->qmake_abslocation).absolutePath());
|
||||
QString qtconfig = dir.filePath("qt" QT_STRINGIFY(QT_VERSION_MAJOR) ".conf");
|
||||
if (QFile::exists(qtconfig))
|
||||
return qtconfig;
|
||||
qtconfig = dir.filePath("qt.conf");
|
||||
if (QFile::exists(qtconfig))
|
||||
return qtconfig;
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
|
||||
{
|
||||
#ifdef QT_BUILD_QMAKE
|
||||
QString qtconfig = qmake_libraryInfoFile();
|
||||
if (QFile::exists(qtconfig))
|
||||
if (!qtconfig.isEmpty())
|
||||
return new QSettings(qtconfig, QSettings::IniFormat);
|
||||
#else
|
||||
QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
|
||||
@ -207,6 +207,9 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
|
||||
#endif
|
||||
if (QCoreApplication::instance()) {
|
||||
QDir pwd(QCoreApplication::applicationDirPath());
|
||||
qtconfig = pwd.filePath(QLatin1String("qt" QT_STRINGIFY(QT_VERSION_MAJOR) ".conf"));
|
||||
if (QFile::exists(qtconfig))
|
||||
return new QSettings(qtconfig, QSettings::IniFormat);
|
||||
qtconfig = pwd.filePath(QLatin1String("qt.conf"));
|
||||
if (QFile::exists(qtconfig))
|
||||
return new QSettings(qtconfig, QSettings::IniFormat);
|
||||
|
Loading…
x
Reference in New Issue
Block a user