mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-23 17:56:50 +03:00
- improved some asserts for progress checking
This commit is contained in:
parent
7030f85826
commit
2bf0aba48a
2 changed files with 5 additions and 5 deletions
|
@ -173,7 +173,7 @@ void FinishedTorrents::updateFinishedList(){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(h.is_paused()) continue;
|
if(h.is_paused()) continue;
|
||||||
Q_ASSERT(torrentStatus.progress <= 1.);
|
Q_ASSERT(torrentStatus.progress <= 1. && torrentStatus.progress >= 0.);
|
||||||
if(torrentStatus.state == torrent_status::downloading || (torrentStatus.state != torrent_status::checking_files && torrentStatus.state != torrent_status::queued_for_checking && torrentStatus.progress < 1.)) {
|
if(torrentStatus.state == torrent_status::downloading || (torrentStatus.state != torrent_status::checking_files && torrentStatus.state != torrent_status::queued_for_checking && torrentStatus.progress < 1.)) {
|
||||||
// What are you doing here? go back to download tab!
|
// What are you doing here? go back to download tab!
|
||||||
qDebug("Info: a torrent was moved from finished to download tab");
|
qDebug("Info: a torrent was moved from finished to download tab");
|
||||||
|
|
|
@ -578,7 +578,7 @@ void GUI::updateDlList(bool force){
|
||||||
if(BTSession->getTorrentsToPauseAfterChecking().indexOf(fileHash) == -1){
|
if(BTSession->getTorrentsToPauseAfterChecking().indexOf(fileHash) == -1){
|
||||||
DLListModel->setData(DLListModel->index(row, NAME), QVariant(QIcon(":/Icons/time.png")), Qt::DecorationRole);
|
DLListModel->setData(DLListModel->index(row, NAME), QVariant(QIcon(":/Icons/time.png")), Qt::DecorationRole);
|
||||||
setRowColor(row, "grey");
|
setRowColor(row, "grey");
|
||||||
Q_ASSERT(torrentStatus.progress <= 1.);
|
Q_ASSERT(torrentStatus.progress <= 1. && torrentStatus.progress >= 0.);
|
||||||
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
|
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -593,7 +593,7 @@ void GUI::updateDlList(bool force){
|
||||||
DLListModel->setData(DLListModel->index(row, NAME), QVariant(QIcon(":/Icons/skin/connecting.png")), Qt::DecorationRole);
|
DLListModel->setData(DLListModel->index(row, NAME), QVariant(QIcon(":/Icons/skin/connecting.png")), Qt::DecorationRole);
|
||||||
setRowColor(row, "grey");
|
setRowColor(row, "grey");
|
||||||
}
|
}
|
||||||
Q_ASSERT(torrentStatus.progress <= 1.);
|
Q_ASSERT(torrentStatus.progress <= 1. && torrentStatus.progress >= 0.);
|
||||||
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
|
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
|
||||||
DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)torrentStatus.download_payload_rate));
|
DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)torrentStatus.download_payload_rate));
|
||||||
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)torrentStatus.upload_payload_rate));
|
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)torrentStatus.upload_payload_rate));
|
||||||
|
@ -610,7 +610,7 @@ void GUI::updateDlList(bool force){
|
||||||
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
|
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
|
||||||
setRowColor(row, "black");
|
setRowColor(row, "black");
|
||||||
}
|
}
|
||||||
Q_ASSERT(torrentStatus.progress <= 1.);
|
Q_ASSERT(torrentStatus.progress <= 1. && torrentStatus.progress >= 0.);
|
||||||
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
|
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
|
||||||
DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)torrentStatus.download_payload_rate));
|
DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)torrentStatus.download_payload_rate));
|
||||||
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)torrentStatus.upload_payload_rate));
|
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)torrentStatus.upload_payload_rate));
|
||||||
|
@ -1633,7 +1633,7 @@ void GUI::torrentChecked(QString hash){
|
||||||
DLListModel->setData(DLListModel->index(row, NAME), QIcon(":/Icons/skin/paused.png"), Qt::DecorationRole);
|
DLListModel->setData(DLListModel->index(row, NAME), QIcon(":/Icons/skin/paused.png"), Qt::DecorationRole);
|
||||||
setRowColor(row, "red");
|
setRowColor(row, "red");
|
||||||
// Update progress in download list
|
// Update progress in download list
|
||||||
Q_ASSERT(torrentStatus.progress <= 1.);
|
Q_ASSERT(torrentStatus.progress <= 1. && torrentStatus.progress >= 0.);
|
||||||
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
|
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
|
||||||
// Delayed Sorting
|
// Delayed Sorting
|
||||||
sortProgressColumnDelayed();
|
sortProgressColumnDelayed();
|
||||||
|
|
Loading…
Reference in a new issue