diff --git a/src/Gui/StartupProcess.cpp b/src/Gui/StartupProcess.cpp index 57b9029d61..6f91024fce 100644 --- a/src/Gui/StartupProcess.cpp +++ b/src/Gui/StartupProcess.cpp @@ -163,24 +163,14 @@ void StartupProcess::registerEventType() void StartupProcess::setThemePaths() { - ParameterGrp::handle hTheme = App::GetApplication().GetParameterGroupByPath( - "User parameter:BaseApp/Preferences/Bitmaps/Theme"); #if !defined(Q_OS_LINUX) QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << QString::fromLatin1(":/icons/FreeCAD-default")); - QIcon::setThemeName(QLatin1String("FreeCAD-default")); -#else - // Option to opt-in into using a Linux desktop icon theme. - // https://forum.freecad.org/viewtopic.php?f=4&t=35624 - bool themePaths = hTheme->GetBool("ThemeSearchPaths", false); - if (!themePaths) { - QStringList searchPaths; - searchPaths.prepend(QString::fromUtf8(":/icons")); - QIcon::setThemeSearchPaths(searchPaths); - QIcon::setThemeName(QLatin1String("FreeCAD-default")); - } #endif + ParameterGrp::handle hTheme = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Bitmaps/Theme"); + std::string searchpath = hTheme->GetASCII("SearchPath"); if (!searchpath.empty()) { QStringList searchPaths = QIcon::themeSearchPaths(); @@ -188,8 +178,13 @@ void StartupProcess::setThemePaths() QIcon::setThemeSearchPaths(searchPaths); } + // KDE file dialog needs icons from the desktop theme + QIcon::setFallbackThemeName(QIcon::themeName()); + std::string name = hTheme->GetASCII("Name"); - if (!name.empty()) { + if (name.empty()) { + QIcon::setThemeName(QLatin1String("FreeCAD-default")); + } else { QIcon::setThemeName(QString::fromLatin1(name.c_str())); } }