- Fixed a bug in torrent progress display

This commit is contained in:
Christophe Dumez
2008-07-16 21:53:34 +00:00
parent 42fa5ef8f3
commit ae2ad8e747
2 changed files with 4 additions and 2 deletions

View File

@@ -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;
}