diff -crB ./bittorrent.cpp ../../qbittorrent-2.2.0beta4-modifs/src/bittorrent.cpp *** ./bittorrent.cpp 2010-02-09 22:35:20.000000000 +0100 --- ../../qbittorrent-2.2.0beta4-modifs/src/bittorrent.cpp 2010-02-17 01:44:47.033851982 +0100 *************** *** 1358,1371 **** float Bittorrent::getRealRatio(QString hash) const{ QTorrentHandle h = getTorrentHandle(hash); ! Q_ASSERT(h.all_time_download() >= 0); Q_ASSERT(h.all_time_upload() >= 0); ! if(h.all_time_download() == 0) { ! if(h.all_time_upload() == 0) return 0; return 101; } ! float ratio = (float)h.all_time_upload()/(float)h.all_time_download(); Q_ASSERT(ratio >= 0.); if(ratio > 100.) ratio = 100.; --- 1358,1372 ---- float Bittorrent::getRealRatio(QString hash) const{ QTorrentHandle h = getTorrentHandle(hash); ! Q_ASSERT(h.total_done() >= 0); Q_ASSERT(h.all_time_upload() >= 0); ! ! if(h.total_done() == 0) { ! if(h.all_time_upload() == 0) return 0; return 101; } ! float ratio = (float)h.all_time_upload()/(float)h.total_done(); Q_ASSERT(ratio >= 0.); if(ratio > 100.) ratio = 100.; Seulement dans ../../qbittorrent-2.2.0beta4-modifs/src: Makefile Seulement dans .: patch Seulement dans .: patch-2.2.0beta4 Seulement dans ../../qbittorrent-2.2.0beta4-modifs/src: qbittorrent diff -crB ./qtorrenthandle.cpp ../../qbittorrent-2.2.0beta4-modifs/src/qtorrenthandle.cpp *** ./qtorrenthandle.cpp 2010-01-31 20:03:34.000000000 +0100 --- ../../qbittorrent-2.2.0beta4-modifs/src/qtorrenthandle.cpp 2010-02-16 23:54:48.749330375 +0100 *************** *** 341,346 **** --- 341,351 ---- return h.status().all_time_download; } + size_type QTorrentHandle::total_done() { + Q_ASSERT(h.is_valid()); + return h.status().total_done; + } + size_type QTorrentHandle::all_time_upload() { Q_ASSERT(h.is_valid()); return h.status().all_time_upload; diff -crB ./qtorrenthandle.h ../../qbittorrent-2.2.0beta4-modifs/src/qtorrenthandle.h *** ./qtorrenthandle.h 2010-01-31 20:03:34.000000000 +0100 --- ../../qbittorrent-2.2.0beta4-modifs/src/qtorrenthandle.h 2010-02-16 23:54:54.341702467 +0100 *************** *** 107,112 **** --- 107,113 ---- size_type total_payload_upload(); size_type all_time_upload(); size_type all_time_download(); + size_type total_done(); QStringList files_path() const; int num_uploads() const; bool is_seed() const;