mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
- Display a ratio of 0.0 if total_upload and total_download are both 0
This commit is contained in:
parent
0153b03160
commit
b7c7245fb5
@ -775,7 +775,9 @@ float bittorrent::getRealRatio(QString hash) const{
|
|||||||
Q_ASSERT(h.all_time_download() >= 0);
|
Q_ASSERT(h.all_time_download() >= 0);
|
||||||
Q_ASSERT(h.all_time_upload() >= 0);
|
Q_ASSERT(h.all_time_upload() >= 0);
|
||||||
if(h.all_time_download() == 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();
|
float ratio = (float)h.all_time_upload()/(float)h.all_time_download();
|
||||||
Q_ASSERT(ratio >= 0.);
|
Q_ASSERT(ratio >= 0.);
|
||||||
|
@ -583,6 +583,7 @@ void DownloadingTorrents::addTorrent(QString hash) {
|
|||||||
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)0.));
|
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, SEEDSLEECH), QVariant(QString::fromUtf8("0/0")));
|
||||||
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)h.progress()));
|
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));
|
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
|
||||||
if(BTSession->isQueueingEnabled())
|
if(BTSession->isQueueingEnabled())
|
||||||
DLListModel->setData(DLListModel->index(row, PRIORITY), QVariant((int)BTSession->getDlTorrentPriority(hash)));
|
DLListModel->setData(DLListModel->index(row, PRIORITY), QVariant((int)BTSession->getDlTorrentPriority(hash)));
|
||||||
|
Loading…
Reference in New Issue
Block a user