kget
torrentfiletreemodel.cpp
Go to the documentation of this file.
43 : parent(parent),file(file),name(name),size(0),chunks(total_chunks),chunks_set(false),percentage(0.0f)
48 TorrentFileTreeModel::Node::Node(Node* parent,const QString & name, const bt::Uint32 total_chunks)
49 : parent(parent),file(0),name(name),size(0),chunks(total_chunks),chunks_set(false),percentage(0.0f)
59 void TorrentFileTreeModel::Node::insert(const QString & path,bt::TorrentFileInterface* file,bt::Uint32 num_chunks)
166 void TorrentFileTreeModel::Node::initPercentage(const bt::TorrentInterface* tc,const bt::BitSet & havechunks)
249 return file->doNotDownload() || file->getPriority() == ONLY_SEED_PRIORITY ? Qt::Unchecked : Qt::Checked;
253 void TorrentFileTreeModel::Node::saveExpandedState(const QModelIndex & index,QSortFilterProxyModel* pm,QTreeView* tv,BEncoder* enc)
275 void TorrentFileTreeModel::Node::loadExpandedState(const QModelIndex & index,QSortFilterProxyModel* pm,QTreeView* tv,BNode* n)
312 TorrentFileTreeModel::TorrentFileTreeModel(bt::TorrentInterface* tc,DeselectMode mode,QObject* parent)
369 QVariant TorrentFileTreeModel::headerData(int section, Qt::Orientation orientation,int role) const
654 void TorrentFileTreeModel::loadExpandedState(QSortFilterProxyModel* pm,QTreeView* tv,const QByteArray & state)
700 void TorrentFileTreeModel::changePriority(const QModelIndexList & indexes,bt::Priority newpriority)
virtual QByteArray saveExpandedState(QSortFilterProxyModel *pm, QTreeView *tv)
Save which items are expanded.
Definition: torrentfiletreemodel.cpp:640
virtual int columnCount(const QModelIndex &parent) const
Definition: torrentfiletreemodel.cpp:361
virtual void loadExpandedState(QSortFilterProxyModel *pm, QTreeView *tv, const QByteArray &state)
Retore the expanded state of the tree.in a QTreeView.
Definition: torrentfiletreemodel.cpp:654
virtual void changePriority(const QModelIndexList &indexes, bt::Priority newpriority)
Change the priority of a bunch of items.
Definition: torrentfiletreemodel.cpp:700
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const
Definition: torrentfiletreemodel.cpp:369
virtual QString dirPath(const QModelIndex &idx)
Get the path of a directory (root directory not included)
Definition: torrentfiletreemodel.cpp:680
void insert(const QString &path, bt::TorrentFileInterface *file, bt::Uint32 num_chunks)
Definition: torrentfiletreemodel.cpp:59
virtual ~TorrentFileTreeModel()
Definition: torrentfiletreemodel.cpp:322
virtual void onCodecChange()
Codec has changed, so update the model.
Definition: torrentfiletreemodel.cpp:340
virtual QModelIndex parent(const QModelIndex &index) const
Definition: torrentfiletreemodel.cpp:436
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
Definition: torrentfiletreemodel.cpp:576
void initPercentage(const bt::TorrentInterface *tc, const bt::BitSet &havechunks)
Definition: torrentfiletreemodel.cpp:166
virtual bt::Uint64 bytesToDownload()
Calculate the number of bytes to download.
Definition: torrentfiletreemodel.cpp:632
void loadExpandedState(const QModelIndex &index, QSortFilterProxyModel *pm, QTreeView *tv, bt::BNode *node)
Definition: torrentfiletreemodel.cpp:275
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
Definition: torrentfiletreemodel.cpp:452
TorrentFileTreeModel(bt::TorrentInterface *tc, DeselectMode mode, QObject *parent)
Definition: torrentfiletreemodel.cpp:312
bt::TorrentFileInterface * file
Definition: torrentfiletreemodel.h:49
virtual void invertCheck()
Invert the check of each file of the torrent.
Definition: torrentfiletreemodel.cpp:601
void saveExpandedState(const QModelIndex &index, QSortFilterProxyModel *pm, QTreeView *tv, bt::BEncoder *enc)
Definition: torrentfiletreemodel.cpp:253
virtual int rowCount(const QModelIndex &parent) const
Definition: torrentfiletreemodel.cpp:348
QList< Node * > children
Definition: torrentfiletreemodel.h:51
void checkStateChanged()
Emitted whenever one or more items changes check state.
Qt::CheckState checkState(const bt::TorrentInterface *tc) const
Definition: torrentfiletreemodel.cpp:224
Node(Node *parent, bt::TorrentFileInterface *file, const QString &name, bt::Uint32 total_chunks)
Definition: torrentfiletreemodel.cpp:41
virtual bt::TorrentFileInterface * indexToFile(const QModelIndex &idx)
Convert a model index to a file.
Definition: torrentfiletreemodel.cpp:668
bt::Uint64 bytesToDownload(const bt::TorrentInterface *tc)
Definition: torrentfiletreemodel.cpp:206
bool emit_check_state_change
Definition: torrentfiletreemodel.h:106
virtual QVariant data(const QModelIndex &index, int role) const
Definition: torrentfiletreemodel.cpp:383
bt::Uint64 fileSize(const bt::TorrentInterface *tc)
Definition: torrentfiletreemodel.cpp:93
Definition: torrentfilemodel.h:39
void updatePercentage(const bt::BitSet &havechunks)
Definition: torrentfiletreemodel.cpp:132
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.