mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 22:22:33 -06:00
Use polymorphism to distinguish folder / file items in torrent content model
Step to address issue #24.
This commit is contained in:
@@ -51,7 +51,7 @@ public:
|
||||
bool allFiltered() const;
|
||||
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const;
|
||||
virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
TorrentContentModelItem::FileType getType(const QModelIndex& index) const;
|
||||
TorrentContentModelItem::ItemType itemType(const QModelIndex& index) const;
|
||||
int getFileIndex(const QModelIndex& index);
|
||||
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
||||
virtual Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
@@ -70,7 +70,7 @@ public slots:
|
||||
void selectNone();
|
||||
|
||||
private:
|
||||
TorrentContentModelItem* m_rootItem;
|
||||
TorrentContentModelFolder* m_rootItem;
|
||||
QVector<TorrentContentModelItem*> m_filesIndex;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user