diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2017-07-10 18:28:29 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2021-01-16 10:51:31 +0000 |
commit | f79192815fdd114945d901e8c169f5d93d44954c (patch) | |
tree | c3f7ab3937ae8d0dd40541da43df109c139a6305 /src | |
parent | 7133780bc626460299ace2c7df99c0c9d67115e6 (diff) |
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>
(cherry picked from commit ab2c61e6384bbb5a0d154caa8f4784f9053147fe)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 301c3ab89a..bb1eafeccd 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -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); |