summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlibraryinfo.cpp
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2024-02-27 17:57:05 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2024-02-28 14:02:43 +0000
commitbdb2f20154c1fa1f0962a46a22afdee453a2db1e (patch)
tree4ee59b1ad2b91136064b9b278d173cfc4c78d013 /src/corelib/global/qlibraryinfo.cpp
parentb42f174cd5be2014ae74453ab2d09742cc83fc36 (diff)
Fix the qtpath issue with lto enabled
Move qtconfManualPath pointer to the unnamed namespace, so it's never exported. Add the static setQtconfManualPath method that sets the pointer at runtime. Fixes: QTBUG-122739 Pick-to: 6.5 6.6 6.7 Change-Id: Icfc631f9680ad5f484920b0fdf3e408b7657c108 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qlibraryinfo.cpp')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index ab49835601..92729b06f1 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -87,10 +87,19 @@ void QLibrarySettings::load()
}
}
+namespace {
+const QString *qtconfManualPath = nullptr;
+}
+
+void QLibraryInfoPrivate::setQtconfManualPath(const QString *path)
+{
+ qtconfManualPath = path;
+}
+
static QSettings *findConfiguration()
{
- if (QLibraryInfoPrivate::qtconfManualPath)
- return new QSettings(*QLibraryInfoPrivate::qtconfManualPath, QSettings::IniFormat);
+ if (qtconfManualPath)
+ return new QSettings(*qtconfManualPath, QSettings::IniFormat);
QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
if (QFile::exists(qtconfig))
@@ -122,8 +131,6 @@ static QSettings *findConfiguration()
return nullptr; //no luck
}
-const QString *QLibraryInfoPrivate::qtconfManualPath = nullptr;
-
QSettings *QLibraryInfoPrivate::configuration()
{
QLibrarySettings *ls = qt_library_settings();