From e5bd602d91a1c7fc12ed1b51e4a7094c39048c03 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 15 Mar 2023 19:31:09 +0100 Subject: [PATCH] Ensure environment settings are effective before applying other settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At least the documentation of `QIcon::setThemeName()` sounds like it could make a difference: ``` The name should correspond to a directory name in the themeSearchPath() … ``` --- settingsdialog/qtsettings.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/settingsdialog/qtsettings.cpp b/settingsdialog/qtsettings.cpp index ca9f273..212f665 100644 --- a/settingsdialog/qtsettings.cpp +++ b/settingsdialog/qtsettings.cpp @@ -152,6 +152,14 @@ void QtSettings::save(QSettings &settings) const */ void QtSettings::apply() { + // apply environment + if (m_d->additionalPluginDirectory.isEmpty()) { + QCoreApplication::addLibraryPath(m_d->additionalPluginDirectory); + } + if (!m_d->additionalIconThemeSearchPath.isEmpty()) { + QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << m_d->additionalIconThemeSearchPath); + } + // read style sheet QString styleSheet; if (m_d->customStyleSheet && !m_d->styleSheetPath.isEmpty()) { @@ -189,14 +197,6 @@ void QtSettings::apply() // apply locale QLocale::setDefault(m_d->customLocale ? QLocale(m_d->localeName) : m_d->defaultLocale); - - // apply environment - if (m_d->additionalPluginDirectory.isEmpty()) { - QCoreApplication::addLibraryPath(m_d->additionalPluginDirectory); - } - if (!m_d->additionalIconThemeSearchPath.isEmpty()) { - QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << m_d->additionalIconThemeSearchPath); - } } /*!