icons: Override system icon theme by default
[quassel.git] / src / qtui / qtui.cpp
index 2cfc810..d899ba8 100644 (file)
@@ -30,6 +30,7 @@
 #include "buffermodel.h"
 #include "chatlinemodel.h"
 #include "contextmenuactionprovider.h"
+#include "icon.h"
 #include "mainwin.h"
 #include "qtuimessageprocessor.h"
 #include "qtuisettings.h"
@@ -64,7 +65,7 @@ QtUi::QtUi()
 
     setupIconTheme();
 
-    QApplication::setWindowIcon(QIcon::fromTheme("quassel"));
+    QApplication::setWindowIcon(icon::get("quassel"));
 
     setContextMenuActionProvider(new ContextMenuActionProvider(this));
     setToolBarActionProvider(new ToolBarActionProvider(this));
@@ -273,7 +274,9 @@ std::vector<std::pair<QString, QString>> QtUi::availableIconThemes() const
     static const std::vector<std::pair<QString, QString>> supported {
         { "breeze", tr("Breeze") },
         { "breeze-dark", tr("Breeze Dark") },
+#ifdef WITH_OXYGEN_ICONS
         { "oxygen", tr("Oxygen") }
+#endif
     };
 
     std::vector<std::pair<QString, QString>> result;
@@ -290,6 +293,12 @@ std::vector<std::pair<QString, QString>> QtUi::availableIconThemes() const
 }
 
 
+QString QtUi::systemIconTheme() const
+{
+    return _systemIconTheme;
+}
+
+
 void QtUi::setupIconTheme()
 {
     // Add paths to our own icon sets to the theme search paths
@@ -336,7 +345,7 @@ void QtUi::refreshIconTheme()
         }
     }
 
-    if (_systemIconTheme.isEmpty() || _systemIconTheme == fallbackTheme || s.value("Icons/OverrideSystemTheme", false).toBool()) {
+    if (_systemIconTheme.isEmpty() || _systemIconTheme == fallbackTheme || s.value("Icons/OverrideSystemTheme", true).toBool()) {
         // We have a valid fallback theme and want to override the system theme (if it's even defined), so we're basically done
         QIcon::setThemeName(fallbackTheme);
         emit iconThemeRefreshed();