From d80951cd53bb89dd0297142edf9baa3af222e8aa Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 31 Aug 2023 23:18:06 +0200 Subject: [PATCH] added missing comment --- retroshare-gui/src/gui/settings/AppearancePage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp index dcfb0350e..8ad086ae9 100755 --- a/retroshare-gui/src/gui/settings/AppearancePage.cpp +++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp @@ -74,8 +74,12 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags) foreach (QString code, LanguageSupport::languageCodes()) { ui.cmboLanguage->addItem(FilesDefs::getIconFromQtResourcePath(":/images/flags/" + code + ".png"), LanguageSupport::languageName(code), code); } - foreach (QString style, QStyleFactory::keys()) { - if(style.toLower() != "gtk2" || (getenv("QT_QPA_PLATFORMTHEME")!=nullptr && !strcmp(getenv("QT_QPA_PLATFORMTHEME"),"gtk2"))) // make sure that if style is gtk2, the system has the correct environment variable set. + + // Note: apparently, on some linux systems (e.g. Debian 11), the gtk2 style makes Qt libs crash when the environment variable is not set. + // So we first check that it's here before start. + + foreach (QString style, QStyleFactory::keys()) { + if(style.toLower() != "gtk2" || (getenv("QT_QPA_PLATFORMTHEME")!=nullptr && !strcmp(getenv("QT_QPA_PLATFORMTHEME"),"gtk2"))) ui.cmboStyle->addItem(style, style.toLower()); }