X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Ficonloader.cpp;h=d3df5b316a695dbe62d864ca93dc6bb5675ce36f;hb=946e79e0243dda74433016060f12abc65883f243;hp=d5dbade0982e3747ffbd5b55508dc843444b00c2;hpb=57d9abdd9cb8506a12f4a2dbb96fd8d840c380c8;p=quassel.git diff --git a/src/uisupport/iconloader.cpp b/src/uisupport/iconloader.cpp index d5dbade0..d3df5b31 100644 --- a/src/uisupport/iconloader.cpp +++ b/src/uisupport/iconloader.cpp @@ -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 * @@ -18,12 +18,15 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#ifndef HAVE_KDE + #include #include #include #include #include "iconloader.h" +#include "util.h" IconLoader IconLoader::_iconLoader; int IconLoader::_groupSize[] = { 48, 22, 22, 16, 32, 22 }; // default sizes taken from Oxygen @@ -51,19 +54,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 = dataDirPaths(); // System theme in $data/icons/$theme foreach(QString dir, dataDirNames) { @@ -72,14 +63,14 @@ void IconLoader::setTheme(const QString &theme) { _themedIconDirNames.append(path); } // Resource for system theme :/icons/$theme - path = QString(":/icons/%2"); + 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); + path = QString("%1/icons/hicolor").arg(dir); if(QFile::exists(path)) _themedIconDirNames.append(path); path = QString("%1/apps/quassel/pics").arg(dir); @@ -133,6 +124,7 @@ QString IconLoader::findIconPath(const QString &name, int size) { if(QFile::exists(path)) return path; } + qWarning() << "Icon not found:" << name << size; return QString(); } @@ -157,3 +149,5 @@ QPixmap SmallIcon(const QString& name, int force_size) { IconLoader *loader = IconLoader::global(); return loader->loadIcon(name, IconLoader::Small, force_size); } + +#endif