Initial support for system Icons (incomplete but good progress)

This commit is contained in:
Christophe Dumez
2010-12-12 19:37:59 +00:00
parent e72d9de34a
commit 052825e5c4
82 changed files with 299 additions and 433 deletions

View File

@@ -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) {