mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-26 11:16:20 +03:00
- Fixed a bug in torrent progress calculation (regression)
This commit is contained in:
parent
15ce9a7369
commit
7a925f15ba
1 changed files with 3 additions and 1 deletions
|
@ -55,7 +55,9 @@ QString QTorrentHandle::name() const {
|
|||
|
||||
float QTorrentHandle::progress() const {
|
||||
Q_ASSERT(h.is_valid());
|
||||
float progress = h.status().progress;
|
||||
if(!h.status().total_wanted)
|
||||
return 0.;
|
||||
float progress = (float)h.status().total_wanted_done/(float)h.status().total_wanted;
|
||||
Q_ASSERT(progress >= 0. && progress <= 1.);
|
||||
return progress;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue