mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Progress calculation patch
This commit is contained in:
parent
ff26ea94f5
commit
1aedd97d4d
2 changed files with 3 additions and 1 deletions
|
@ -267,7 +267,7 @@ void FinishedTorrents::updateFinishedList(){
|
||||||
if (reponse == QMessageBox::Yes) {
|
if (reponse == QMessageBox::Yes) {
|
||||||
qDebug("Info: a torrent was moved from finished to download tab");
|
qDebug("Info: a torrent was moved from finished to download tab");
|
||||||
deleteTorrent(hash);
|
deleteTorrent(hash);
|
||||||
BTSession->setFinishedTorrent(hash);
|
BTSession->setUnfinishedTorrent(hash);
|
||||||
emit torrentMovedFromFinishedList(hash);
|
emit torrentMovedFromFinishedList(hash);
|
||||||
}
|
}
|
||||||
else if (reponse == QMessageBox::No) {
|
else if (reponse == QMessageBox::No) {
|
||||||
|
|
|
@ -57,6 +57,8 @@ float QTorrentHandle::progress() const {
|
||||||
Q_ASSERT(h.is_valid());
|
Q_ASSERT(h.is_valid());
|
||||||
if(!h.status().total_wanted)
|
if(!h.status().total_wanted)
|
||||||
return 0.;
|
return 0.;
|
||||||
|
if (h.status().total_wanted_done == h.status().total_wanted)
|
||||||
|
return 1.;
|
||||||
float progress = (float)h.status().total_wanted_done/(float)h.status().total_wanted;
|
float progress = (float)h.status().total_wanted_done/(float)h.status().total_wanted;
|
||||||
Q_ASSERT(progress >= 0. && progress <= 1.);
|
Q_ASSERT(progress >= 0. && progress <= 1.);
|
||||||
return progress;
|
return progress;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue