-# endif
-
- // System theme in $data/icons/$theme
- foreach(QString dir, dataDirNames) {
- path = QString("%1/icons/%2").arg(dir, theme);
- if(QFile::exists(path))
- _themedIconDirNames.append(path);
- }
- // Resource for system theme :/icons/$theme
- path = QString(":/icons/%1").arg(theme);
- 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);
- if(QFile::exists(path))
- _themedIconDirNames.append(path);
- path = QString("%1/apps/quassel/pics").arg(dir);
- if(QFile::exists(path))
- _plainIconDirNames.append(path);
- }
-
- // Same for :/icons/hicolor and :/pics
- path = QString(":/icons/hicolor");
- if(QFile::exists(path))
- _themedIconDirNames.append(path);
-
- path = QString(":/pics");
- if(QFile::exists(path))
- _plainIconDirNames.append(path);
+#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 + '/';
+ if (QFile::exists(path))
+ _themedIconDirNames << path;
+ }
+ foreach(const QString &dir, iconDirNames) {
+ QString path = dir + "hicolor/";
+ if (QFile::exists(path))
+ _themedIconDirNames << path;
+ }
+
+ // We ship some plain (non-themed) icons in $data/pics
+ foreach(const QString &dir, Quassel::dataDirPaths()) {
+ QString path = dir + "pics/";
+ if (QFile::exists(path))
+ _plainIconDirNames << path;
+ }
+ // And of course, our resource path
+ if (QFile::exists(":/pics"))
+ _plainIconDirNames << ":/pics";