mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
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.
This commit is contained in:
parent
db88c2d6a5
commit
f52dcc08eb
1 changed files with 2 additions and 9 deletions
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileIconProvider>
|
||||
#include <QFileInfo>
|
||||
#include <QIcon>
|
||||
|
@ -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()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue