Use of system icon theme can now be disabled

This commit is contained in:
Christophe Dumez
2011-01-01 13:05:28 +00:00
parent 5dfca9c685
commit 83ff66e0b1
27 changed files with 329 additions and 151 deletions

View File

@@ -84,33 +84,6 @@ public:
return libtorrent::sha1_hash(qPrintable(hash));
}
#ifndef DISABLE_GUI
static inline QIcon getIcon(const QString& iconId) {
#if (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
const QIcon icon = QIcon::fromTheme(iconId, QIcon(":/Icons/oxygen/"+iconId+".png"));
#else
const QIcon icon(":/Icons/oxygen/"+iconId+".png");
#endif
Q_ASSERT(!icon.isNull());
return icon;
}
#endif
static QString getIconPath(const QString &iconId) {
#if !defined(DISABLE_GUI) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
QString path = QDir::temp().absoluteFilePath(iconId+".png");
if(!QFile::exists(path)) {
const QIcon icon = QIcon::fromTheme(iconId);
if(icon.isNull()) return ":/Icons/oxygen/"+iconId+".png";
QPixmap px = icon.pixmap(32);
px.save(path);
}
return path;
#else
return ":/Icons/oxygen/"+iconId+".png";
#endif
}
static void chmod644(const QDir& folder);
static inline QString removeLastPathPart(QString path) {