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)
bool hasIndex(int row, int column, const QModelIndex &parent) const
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
virtual QByteArray saveExpandedState(QSortFilterProxyModel *pm, QTreeView *tv)
Save which items are expanded.
Definition: torrentfiletreemodel.cpp:640
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
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
const QObjectList & children() const
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
void setExpanded(const QModelIndex &index, bool expanded)
const char * name() const
void reset()
bool isValid() const
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
Definition: torrentfiletreemodel.cpp:576
int toInt(bool *ok) const
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
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
bool isEmpty() const
int row() const
void * internalPointer() const
TorrentFileTreeModel(bt::TorrentInterface *tc, DeselectMode mode, QObject *parent)
Definition: torrentfiletreemodel.cpp:312
bt::TorrentFileInterface * file
Definition: torrentfiletreemodel.h:49
QModelIndex parent() const
bool isExpanded(const QModelIndex &index) const
QModelIndex createIndex(int row, int column, void *ptr) const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
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
QModelIndex child(int row, int column) const
virtual int rowCount(const QModelIndex &parent) const
Definition: torrentfiletreemodel.cpp:348
QList< Node * > children
Definition: torrentfiletreemodel.h:51
QString mid(int position, int n) const
QVariant data(int role) const
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
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
int column() const
virtual bt::TorrentFileInterface * indexToFile(const QModelIndex &idx)
Convert a model index to a file.
Definition: torrentfiletreemodel.cpp:668
QString left(int n) const
bt::Uint64 bytesToDownload(const bt::TorrentInterface *tc)
Definition: torrentfiletreemodel.cpp:206
QObject * parent() const
bool emit_check_state_change
Definition: torrentfiletreemodel.h:106
virtual QVariant data(const QModelIndex &index, int role) const
Definition: torrentfiletreemodel.cpp:383
QString toString() const
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.