Add command line parameter for overriding the system icon theme
[quassel.git] / src / qtui / qtuiapplication.cpp
index cd95678..3d1d378 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "qtuiapplication.h"
 
+#include <QIcon>
 #include <QStringList>
 
 #ifdef HAVE_KDE
@@ -117,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);