Don't show migration warnings if we don't have old settings to migrate
[quassel.git] / src / uisupport / iconloader.cpp
index d356b70..354e0ee 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-08 by the Quassel IRC Team                         *
+ *   Copyright (C) 2005-09 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -26,6 +26,8 @@
 #include <QFile>
 
 #include "iconloader.h"
+#include "quassel.h"
+#include "util.h"
 
 IconLoader IconLoader::_iconLoader;
 int IconLoader::_groupSize[] = { 48, 22, 22, 16, 32, 22 };  // default sizes taken from Oxygen
@@ -53,19 +55,7 @@ void IconLoader::setTheme(const QString &theme) {
   _themedIconDirNames.clear();
   _plainIconDirNames.clear();
   QString path;
-  QStringList dataDirNames = QString(qgetenv("XDG_DATA_DIRS")).split(':', QString::SkipEmptyParts);
-
-// Provide a fallback
-# ifdef Q_OS_UNIX
-    if(dataDirNames.isEmpty()) dataDirNames.append("/usr/share");
-    // on UNIX, we always check our install prefix
-    QString appDir = QCoreApplication::applicationDirPath();
-    int binpos = appDir.lastIndexOf("/bin");
-    if(binpos >= 0) {
-      appDir.replace(binpos, 4, "/share");
-      if(!dataDirNames.contains(appDir)) dataDirNames.append(appDir);
-    }
-# endif
+  QStringList dataDirNames = Quassel::dataDirPaths();
 
   // System theme in $data/icons/$theme
   foreach(QString dir, dataDirNames) {
@@ -135,6 +125,7 @@ QString IconLoader::findIconPath(const QString &name, int size) {
     if(QFile::exists(path)) return path;
   }
 
+  qWarning() << "Icon not found:" << name << size;
   return QString();
 }