mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Initial support for system Icons (incomplete but good progress)
This commit is contained in:
16
src/misc.h
16
src/misc.h
@@ -42,6 +42,10 @@
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
#include <QIcon>
|
||||
#endif
|
||||
|
||||
#include <libtorrent/torrent_info.hpp>
|
||||
#include <libtorrent/torrent_handle.hpp>
|
||||
|
||||
@@ -81,6 +85,18 @@ public:
|
||||
return libtorrent::sha1_hash(qPrintable(hash));
|
||||
}
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
static inline QIcon getIcon(const QString& id) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||
const QIcon icon = QIcon::fromTheme(id, QIcon(":/Icons/oxygen/"+id+".png"));
|
||||
#else
|
||||
const QIcon icon(":/Icons/oxygen/"+id+".png");
|
||||
#endif
|
||||
Q_ASSERT(!icon.isNull());
|
||||
return icon;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void chmod644(const QDir& folder);
|
||||
|
||||
static inline QString removeLastPathPart(QString path) {
|
||||
|
||||
Reference in New Issue
Block a user