Remove unneeded conditionals
[quassel.git] / src / qtui / qtuiapplication.cpp
index cd95678..a279442 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
+ *   Copyright (C) 2005-2015 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
 
 #include "qtuiapplication.h"
 
+#include <QIcon>
 #include <QStringList>
 
-#ifdef HAVE_KDE
+#ifdef HAVE_KDE4
 #  include <KStandardDirs>
 #endif
 
@@ -33,7 +34,7 @@
 #include "qtuisettings.h"
 
 QtUiApplication::QtUiApplication(int &argc, char **argv)
-#ifdef HAVE_KDE
+#ifdef HAVE_KDE4
     : KApplication(),
 #else
     : QApplication(argc, argv),
@@ -41,7 +42,7 @@ QtUiApplication::QtUiApplication(int &argc, char **argv)
     Quassel(),
     _aboutToQuit(false)
 {
-#ifdef HAVE_KDE
+#ifdef HAVE_KDE4
     Q_UNUSED(argc); Q_UNUSED(argv);
 
     // We need to setup KDE's data dirs
@@ -51,15 +52,15 @@ QtUiApplication::QtUiApplication(int &argc, char **argv)
     dataDirs.append(":/data/");
     setDataDirPaths(dataDirs);
 
-#else /* HAVE_KDE */
+#else /* HAVE_KDE4 */
 
     setDataDirPaths(findDataDirPaths());
 
-#endif /* HAVE_KDE */
+#endif /* HAVE_KDE4 */
 
-#if defined(HAVE_KDE) || defined(Q_OS_MAC)
+#if defined(HAVE_KDE4) || defined(Q_OS_MAC)
     disableCrashhandler();
-#endif /* HAVE_KDE || Q_OS_MAC */
+#endif /* HAVE_KDE4 || Q_OS_MAC */
     setRunMode(Quassel::ClientOnly);
 
 #if QT_VERSION < 0x050000
@@ -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);