- // Resource for system theme :/icons/$theme
- path = QString(":/icons/%2");
- if(QFile::exists(path))
- _themedIconDirNames.append(path);
-
- // Own icons in $data/apps/quassel/icons/hicolor
- // Also, plain icon dirs $data/apps/quassel/pics
- foreach(QString dir, dataDirNames) {
- path = QString("%1/apps/quassel/icons/hicolor").arg(dir);
+#ifdef Q_OS_UNIX
+ else {
+ // Provide a fallback
+ iconDirNames << "/usr/share/icons/";
+ }
+ // Add our prefix too
+ QString appDir = QCoreApplication::applicationDirPath();
+ int binpos = appDir.lastIndexOf("/bin");
+ if(binpos >= 0) {
+ appDir.replace(binpos, 4, "/share");
+ appDir.append("/icons/");
+ if(!iconDirNames.contains(appDir))
+ iconDirNames.append(appDir);
+ }
+#endif
+
+ // Now look for an icons/ subdir in our data paths
+ foreach(const QString &dir, Quassel::dataDirPaths())
+ iconDirNames << dir + "icons/";
+
+ // Add our resource path too
+ iconDirNames << ":/icons/";
+
+ // Ready do add theme names
+ foreach(const QString &dir, iconDirNames) {
+ QString path = dir + theme + '/';