Make Breeze the default icon theme
[quassel.git] / src / qtui / qtuiapplication.cpp
index 755a032..6777a56 100644 (file)
@@ -145,12 +145,29 @@ bool QtUiApplication::init()
             return false;
         }
 
+        // Checking if settings Icon Theme is valid
+        QString savedIcontheme = QtUiSettings().value("IconTheme", QVariant("")).toString();
+#ifndef WITH_OXYGEN
+        if (savedIcontheme == "oxygen")
+            QtUiSettings().remove("IconTheme");
+#endif
+#ifndef WITH_BREEZE
+        if (savedIcontheme == "breeze")
+            QtUiSettings().remove("IconTheme");
+#endif
+#ifndef WITH_BREEZE_DARK
+        if (savedIcontheme == "breezedark")
+            QtUiSettings().remove("IconTheme");
+#endif
+
         // Set the icon theme
         if (Quassel::isOptionSet("icontheme"))
             QIcon::setThemeName(Quassel::optionValue("icontheme"));
+        else if (QtUiSettings().value("IconTheme", QVariant("")).toString() != "")
+            QIcon::setThemeName(QtUiSettings().value("IconTheme").toString());
         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");
+            // Some platforms don't set a default icon theme; chances are we can find our bundled theme though
+            QIcon::setThemeName("breeze");
 
         // session resume
         QtUi *gui = new QtUi();