mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-05 15:12:32 -06:00
Follow project coding style. Issue #2192.
This commit is contained in:
@@ -34,48 +34,70 @@
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
|
||||
namespace prio {
|
||||
enum FilePriority {IGNORED=0, NORMAL=1, HIGH=6, MAXIMUM=7, MIXED=-1};
|
||||
namespace prio
|
||||
{
|
||||
enum FilePriority
|
||||
{
|
||||
IGNORED=0,
|
||||
NORMAL=1,
|
||||
HIGH=6,
|
||||
MAXIMUM=7,
|
||||
MIXED=-1
|
||||
};
|
||||
}
|
||||
|
||||
class TorrentContentModelFolder;
|
||||
|
||||
class TorrentContentModelItem {
|
||||
class TorrentContentModelItem
|
||||
{
|
||||
public:
|
||||
enum TreeItemColumns {COL_NAME, COL_SIZE, COL_PROGRESS, COL_PRIO, COL_REMAINING, NB_COL};
|
||||
enum ItemType { FileType, FolderType };
|
||||
enum TreeItemColumns
|
||||
{
|
||||
COL_NAME,
|
||||
COL_SIZE,
|
||||
COL_PROGRESS,
|
||||
COL_PRIO,
|
||||
COL_REMAINING,
|
||||
NB_COL
|
||||
};
|
||||
|
||||
TorrentContentModelItem(TorrentContentModelFolder* parent);
|
||||
virtual ~TorrentContentModelItem();
|
||||
enum ItemType
|
||||
{
|
||||
FileType,
|
||||
FolderType
|
||||
};
|
||||
|
||||
inline bool isRootItem() const { return !m_parentItem; }
|
||||
TorrentContentModelFolder* parent() const;
|
||||
virtual ItemType itemType() const = 0;
|
||||
TorrentContentModelItem(TorrentContentModelFolder *parent);
|
||||
virtual ~TorrentContentModelItem();
|
||||
|
||||
QString name() const;
|
||||
void setName(const QString& name);
|
||||
bool isRootItem() const;
|
||||
TorrentContentModelFolder *parent() const;
|
||||
virtual ItemType itemType() const = 0;
|
||||
|
||||
qulonglong size() const;
|
||||
qreal progress() const;
|
||||
qulonglong remaining() const;
|
||||
QString name() const;
|
||||
void setName(const QString &name);
|
||||
|
||||
int priority() const;
|
||||
virtual void setPriority(int new_prio, bool update_parent = true) = 0;
|
||||
qulonglong size() const;
|
||||
qreal progress() const;
|
||||
qulonglong remaining() const;
|
||||
|
||||
int columnCount() const;
|
||||
QVariant data(int column) const;
|
||||
int row() const;
|
||||
int priority() const;
|
||||
virtual void setPriority(int newPriority, bool updateParent = true) = 0;
|
||||
|
||||
int columnCount() const;
|
||||
QVariant data(int column) const;
|
||||
int row() const;
|
||||
|
||||
protected:
|
||||
TorrentContentModelFolder* m_parentItem;
|
||||
// Root item members
|
||||
QList<QVariant> m_itemData;
|
||||
// Non-root item members
|
||||
QString m_name;
|
||||
qulonglong m_size;
|
||||
qulonglong m_remaining;
|
||||
int m_priority;
|
||||
qreal m_progress;
|
||||
TorrentContentModelFolder *m_parentItem;
|
||||
// Root item members
|
||||
QList<QVariant> m_itemData;
|
||||
// Non-root item members
|
||||
QString m_name;
|
||||
qulonglong m_size;
|
||||
qulonglong m_remaining;
|
||||
int m_priority;
|
||||
qreal m_progress;
|
||||
};
|
||||
|
||||
#endif // TORRENTCONTENTMODELITEM_H
|
||||
|
||||
Reference in New Issue
Block a user