mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Use of system icon theme can now be disabled
This commit is contained in:
27
src/misc.h
27
src/misc.h
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user