From 5c6c9730bd840bcd51f32988dd4e224fed69c85d Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sat, 25 Oct 2014 22:35:01 +0200 Subject: [PATCH] Add command line parameter for overriding the system icon theme Quassel uses many icons that are not part of the freedesktop naming spec, but supported by KDE icon themes. If Quassel is run in another environment, such as GNOME, which would select a non-KDE icon theme, there may be missing icons. In such cases, it is recommended to install the Oxygen icon theme and start the Quassel client with '--icontheme=oxygen' to override the system setting. Of course, you are free to choose any other theme as well. Note that oxygen is already selected as a fallback if the platform does not tell Qt about its icon theme (for example, on non-Linux platforms). --- src/common/main.cpp | 1 + src/qtui/qtuiapplication.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/main.cpp b/src/common/main.cpp index b973bba6..31340cc8 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -116,6 +116,7 @@ int main(int argc, char **argv) #ifndef BUILD_CORE // put client-only arguments here + cliParser->addOption("icontheme ", 0, "Override the system icon theme ('oxygen' is recommended)"); cliParser->addOption("qss ", 0, "Load a custom application stylesheet"); cliParser->addSwitch("debugbufferswitches", 0, "Enables debugging for bufferswitches"); cliParser->addSwitch("debugmodel", 0, "Enables debugging for models"); diff --git a/src/qtui/qtuiapplication.cpp b/src/qtui/qtuiapplication.cpp index 5bf11bbe..3d1d3780 100644 --- a/src/qtui/qtuiapplication.cpp +++ b/src/qtui/qtuiapplication.cpp @@ -68,10 +68,6 @@ QtUiApplication::QtUiApplication(int &argc, char **argv) #else qInstallMessageHandler(Client::logMessage); #endif - - // Some platforms don't set a default icon theme; chances are we can find our bundled Oxygen theme though - if (QIcon::themeName().isEmpty()) - QIcon::setThemeName("oxygen"); } @@ -122,6 +118,13 @@ bool QtUiApplication::init() return false; } + // Set the icon theme + if (Quassel::isOptionSet("icontheme")) + QIcon::setThemeName(Quassel::optionValue("icontheme")); + else if (QIcon::themeName().isEmpty()) + // Some platforms don't set a default icon theme; chances are we can find our bundled Oxygen theme though + QIcon::setThemeName("oxygen"); + // session resume QtUi *gui = new QtUi(); Client::init(gui); -- 2.20.1