qBittorrent
|
#include <torrentcontentmodelitem.h>
Public Types | |
enum | TreeItemColumns { COL_NAME , COL_SIZE , COL_PROGRESS , COL_PRIO , COL_REMAINING , COL_AVAILABILITY , NB_COL } |
enum | ItemType { FileType , FolderType } |
Public Member Functions | |
TorrentContentModelItem (TorrentContentModelFolder *parent) | |
virtual | ~TorrentContentModelItem () |
bool | isRootItem () const |
TorrentContentModelFolder * | parent () const |
virtual ItemType | itemType () const =0 |
QString | name () const |
void | setName (const QString &name) |
qulonglong | size () const |
qreal | progress () const |
qulonglong | remaining () const |
qreal | availability () const |
BitTorrent::DownloadPriority | priority () const |
virtual void | setPriority (BitTorrent::DownloadPriority newPriority, bool updateParent=true)=0 |
int | columnCount () const |
QString | displayData (int column) const |
QVariant | underlyingData (int column) const |
int | row () const |
Protected Attributes | |
TorrentContentModelFolder * | m_parentItem |
QVector< QString > | m_itemData |
QString | m_name |
qulonglong | m_size |
qulonglong | m_remaining |
BitTorrent::DownloadPriority | m_priority |
qreal | m_progress |
qreal | m_availability |
Definition at line 40 of file torrentcontentmodelitem.h.
Enumerator | |
---|---|
COL_NAME | |
COL_SIZE | |
COL_PROGRESS | |
COL_PRIO | |
COL_REMAINING | |
COL_AVAILABILITY | |
NB_COL |
Definition at line 45 of file torrentcontentmodelitem.h.
|
explicit |
Definition at line 38 of file torrentcontentmodelitem.cpp.
|
virtualdefault |
qreal TorrentContentModelItem::availability | ( | ) | const |
Definition at line 87 of file torrentcontentmodelitem.cpp.
References isRootItem(), m_availability, and m_size.
Referenced by displayData(), TorrentContentModelFolder::recalculateAvailability(), TorrentContentModelFile::setAvailability(), and underlyingData().
int TorrentContentModelItem::columnCount | ( | ) | const |
Definition at line 100 of file torrentcontentmodelitem.cpp.
References NB_COL.
Referenced by TorrentContentModel::columnCount().
QString TorrentContentModelItem::displayData | ( | int | column | ) | const |
Definition at line 105 of file torrentcontentmodelitem.cpp.
References availability(), C_THIN_SPACE, COL_AVAILABILITY, COL_NAME, COL_PRIO, COL_PROGRESS, COL_REMAINING, COL_SIZE, Utils::Misc::friendlyUnit(), Utils::String::fromDouble(), BitTorrent::High, BitTorrent::Ignored, isRootItem(), m_itemData, m_name, m_priority, m_progress, m_size, BitTorrent::Maximum, BitTorrent::Mixed, remaining(), and anonymous_namespace{preferences.cpp}::value().
Referenced by TorrentContentModel::headerData().
bool TorrentContentModelItem::isRootItem | ( | ) | const |
Definition at line 50 of file torrentcontentmodelitem.cpp.
References m_parentItem.
Referenced by availability(), TorrentContentModelFolder::deleteAllChildren(), displayData(), TorrentContentModelFolder::increaseSize(), name(), priority(), progress(), TorrentContentModelFolder::recalculateAvailability(), TorrentContentModelFolder::recalculateProgress(), remaining(), setName(), size(), underlyingData(), and TorrentContentModelFolder::updatePriority().
|
pure virtual |
Implemented in TorrentContentModelFolder, and TorrentContentModelFile.
Referenced by TorrentContentModelFolder::appendChild(), TorrentContentModelFolder::childFolderWithName(), TorrentContentModelFolder::recalculateAvailability(), and TorrentContentModelFolder::recalculateProgress().
QString TorrentContentModelItem::name | ( | ) | const |
Definition at line 55 of file torrentcontentmodelitem.cpp.
References isRootItem(), and m_name.
Referenced by TorrentContentModelFolder::childFolderWithName(), setName(), and TorrentContentModelFolder::TorrentContentModelFolder().
TorrentContentModelFolder * TorrentContentModelItem::parent | ( | ) | const |
Definition at line 185 of file torrentcontentmodelitem.cpp.
References m_parentItem.
Referenced by TorrentContentModel::parent(), TorrentContentModelFile::TorrentContentModelFile(), and TorrentContentModelFolder::TorrentContentModelFolder().
BitTorrent::DownloadPriority TorrentContentModelItem::priority | ( | ) | const |
Definition at line 94 of file torrentcontentmodelitem.cpp.
References isRootItem(), and m_priority.
Referenced by TorrentContentModelFolder::recalculateAvailability(), TorrentContentModelFolder::recalculateProgress(), and TorrentContentModel::selectAll().
qreal TorrentContentModelItem::progress | ( | ) | const |
Definition at line 74 of file torrentcontentmodelitem.cpp.
References isRootItem(), m_progress, and m_size.
Referenced by TorrentContentModelFolder::recalculateProgress(), TorrentContentModelFile::setProgress(), and underlyingData().
qulonglong TorrentContentModelItem::remaining | ( | ) | const |
Definition at line 81 of file torrentcontentmodelitem.cpp.
References BitTorrent::Ignored, isRootItem(), m_priority, and m_remaining.
Referenced by displayData(), TorrentContentModelFolder::recalculateProgress(), and underlyingData().
int TorrentContentModelItem::row | ( | ) | const |
Definition at line 178 of file torrentcontentmodelitem.cpp.
References TorrentContentModelFolder::children(), and m_parentItem.
Referenced by TorrentContentModelFolder::child(), and TorrentContentModel::parent().
void TorrentContentModelItem::setName | ( | const QString & | name | ) |
Definition at line 61 of file torrentcontentmodelitem.cpp.
References isRootItem(), m_name, and name().
|
pure virtual |
Implemented in TorrentContentModelFolder, and TorrentContentModelFile.
Referenced by TorrentContentModel::selectAll(), TorrentContentModel::selectNone(), and TorrentContentModelFolder::setPriority().
qulonglong TorrentContentModelItem::size | ( | ) | const |
Definition at line 67 of file torrentcontentmodelitem.cpp.
References isRootItem(), and m_size.
Referenced by TorrentContentModelFolder::appendChild(), TorrentContentModelFolder::recalculateAvailability(), and TorrentContentModelFolder::recalculateProgress().
QVariant TorrentContentModelItem::underlyingData | ( | int | column | ) | const |
Definition at line 153 of file torrentcontentmodelitem.cpp.
References availability(), COL_AVAILABILITY, COL_NAME, COL_PRIO, COL_PROGRESS, COL_REMAINING, COL_SIZE, isRootItem(), m_itemData, m_name, m_priority, m_size, progress(), and remaining().
|
protected |
Definition at line 96 of file torrentcontentmodelitem.h.
Referenced by availability(), TorrentContentModelFolder::recalculateAvailability(), and TorrentContentModelFile::setAvailability().
|
protected |
Definition at line 89 of file torrentcontentmodelitem.h.
Referenced by displayData(), TorrentContentModelFolder::TorrentContentModelFolder(), and underlyingData().
|
protected |
Definition at line 91 of file torrentcontentmodelitem.h.
Referenced by displayData(), name(), setName(), TorrentContentModelFile::TorrentContentModelFile(), TorrentContentModelFolder::TorrentContentModelFolder(), and underlyingData().
|
protected |
Definition at line 87 of file torrentcontentmodelitem.h.
Referenced by TorrentContentModelFolder::increaseSize(), isRootItem(), parent(), row(), TorrentContentModelFile::setPriority(), and TorrentContentModelFolder::setPriority().
|
protected |
Definition at line 94 of file torrentcontentmodelitem.h.
Referenced by displayData(), priority(), remaining(), TorrentContentModelFile::setPriority(), TorrentContentModelFolder::setPriority(), and underlyingData().
|
protected |
Definition at line 95 of file torrentcontentmodelitem.h.
Referenced by displayData(), progress(), TorrentContentModelFolder::recalculateProgress(), and TorrentContentModelFile::setProgress().
|
protected |
Definition at line 93 of file torrentcontentmodelitem.h.
Referenced by TorrentContentModelFolder::recalculateProgress(), remaining(), and TorrentContentModelFile::setProgress().
|
protected |
Definition at line 92 of file torrentcontentmodelitem.h.
Referenced by availability(), displayData(), TorrentContentModelFolder::increaseSize(), progress(), TorrentContentModelFile::setProgress(), size(), TorrentContentModelFile::TorrentContentModelFile(), and underlyingData().