diff --git a/Changelog b/Changelog index 23f180bd5..1145191d6 100644 --- a/Changelog +++ b/Changelog @@ -7,6 +7,7 @@ - BUGFIX: Cleanly fixed popup menus position in lists (no more workarounds) - BUGFIX: Fixed memory leak in search engine - BUGFIX: Torrents with an infinite ratio are no longer affected by ratio_limit set in program preferences + - BUGFIX: Display a ratio of 0.0 if total_upload and total_download are both 0 * Sun Apr 5 2009 - Christophe Dumez - v1.3.3 - BUGFIX: Fixed Web UI torrent upload form diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 3c53a30b4..a6fa7362d 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -771,7 +771,9 @@ float bittorrent::getRealRatio(QString hash) const{ Q_ASSERT(h.all_time_download() >= 0); Q_ASSERT(h.all_time_upload() >= 0); if(h.all_time_download() == 0) { - return 101; + 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.); diff --git a/src/downloadingTorrents.cpp b/src/downloadingTorrents.cpp index 3d85a80ab..664077b5d 100644 --- a/src/downloadingTorrents.cpp +++ b/src/downloadingTorrents.cpp @@ -577,6 +577,7 @@ void DownloadingTorrents::addTorrent(QString hash) { DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)0.)); DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(QString::fromUtf8("0/0"))); DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)h.progress())); + DLListModel->setData(DLListModel->index(row, RATIO), QVariant((double)0.)); DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1)); if(BTSession->isQueueingEnabled()) DLListModel->setData(DLListModel->index(row, PRIORITY), QVariant((int)BTSession->getDlTorrentPriority(hash)));