X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fengine%2FQTorrentHandle.cpp;fp=src%2Fengine%2FQTorrentHandle.cpp;h=3fb6ec088248dd31e9d2b19fbd02358e359c8aed;hp=c69162ceefcee1aafe7a3e3eb8c9a55c9a86abda;hb=08828f51a534f17235944d186b8f1b0c69696e1b;hpb=45e692ff47151854cc149c514d3a53285f0f195a diff --git a/src/engine/QTorrentHandle.cpp b/src/engine/QTorrentHandle.cpp index c69162c..3fb6ec0 100644 --- a/src/engine/QTorrentHandle.cpp +++ b/src/engine/QTorrentHandle.cpp @@ -55,20 +55,6 @@ QString QTorrentHandle::name() const return QString::fromStdString(torrentHandle_.name()); } - - - -bool QTorrentHandle::operator==(QTorrentHandle const& h) -{ - return torrentHandle_ == h.torrentHandle_; -} - - -bool QTorrentHandle::operator<(QTorrentHandle const& h) -{ - return torrentHandle_ < h.torrentHandle_; -} - size_t QTorrentHandle::getTotalSize() const { TorrentInfo info = getTorrentInfo(); @@ -99,18 +85,21 @@ float QTorrentHandle::downloadRate() const return statusTmp.download_rate; } + qint32 QTorrentHandle::numSeeds() const { TorrentStatus statusTmp = status(); return statusTmp.list_seeds; } + qint32 QTorrentHandle::numLeeches() const { TorrentStatus statusTmp = status(); return (statusTmp.list_peers - statusTmp.list_seeds); } + qint32 QTorrentHandle::ratio() const { TorrentStatus statusTmp = status(); @@ -125,6 +114,25 @@ qint32 QTorrentHandle::ratio() const } +TorrentHandle QTorrentHandle::getHandle() const +{ + return torrentHandle_; +} + + +bool QTorrentHandle::operator==(QTorrentHandle const& h) const +{ + return torrentHandle_ == h.torrentHandle_; +} + + +bool QTorrentHandle::operator<(QTorrentHandle const& h) const +{ + return torrentHandle_ < h.torrentHandle_; +} + + + QString QTorrentHandle::GetStatusString(TorrentStatus const& status) const { switch (status.state) { @@ -147,4 +155,5 @@ QString QTorrentHandle::GetStatusString(TorrentStatus const& status) const } } + \ No newline at end of file