From f52dcc08ebbdfcf836e9aead4979e939b714b3af Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 1 Jun 2019 01:36:10 +0800 Subject: [PATCH] Use native folder icon in content tree This icon is used in content tree where all icons should be OS native and not the ones from qbt. --- src/gui/torrentcontentmodel.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/gui/torrentcontentmodel.cpp b/src/gui/torrentcontentmodel.cpp index 1602834aa..bc336e3aa 100644 --- a/src/gui/torrentcontentmodel.cpp +++ b/src/gui/torrentcontentmodel.cpp @@ -30,7 +30,6 @@ #include -#include #include #include #include @@ -51,8 +50,8 @@ #include "base/bittorrent/downloadpriority.h" #include "base/global.h" -#include "base/utils/misc.h" #include "base/utils/fs.h" +#include "base/utils/misc.h" #include "guiiconprovider.h" #include "torrentcontentmodelfile.h" #include "torrentcontentmodelfolder.h" @@ -64,12 +63,6 @@ namespace { - QIcon getDirectoryIcon() - { - static QIcon cached = GuiIconProvider::instance()->getIcon("inode-directory"); - return cached; - } - class UnifiedFileIconProvider : public QFileIconProvider { public: @@ -359,7 +352,7 @@ QVariant TorrentContentModel::data(const QModelIndex &index, int role) const if ((index.column() == TorrentContentModelItem::COL_NAME) && (role == Qt::DecorationRole)) { if (item->itemType() == TorrentContentModelItem::FolderType) - return getDirectoryIcon(); + return m_fileIconProvider->icon(QFileIconProvider::Folder); return m_fileIconProvider->icon(QFileInfo(item->name())); }