diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-04-03 19:56:57 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-04-03 19:56:57 +0800 |
commit | cddf3b851d38ff7f5aa72a2e9175a2fab47404d1 (patch) | |
tree | f202cd24b341558655c30ac3a913448468aeb9e6 /embed | |
parent | d54c056c08cca6e992c9dfcd2a1569695b3c5ece (diff) | |
download | gsoc2013-epiphany-cddf3b851d38ff7f5aa72a2e9175a2fab47404d1.tar gsoc2013-epiphany-cddf3b851d38ff7f5aa72a2e9175a2fab47404d1.tar.gz gsoc2013-epiphany-cddf3b851d38ff7f5aa72a2e9175a2fab47404d1.tar.bz2 gsoc2013-epiphany-cddf3b851d38ff7f5aa72a2e9175a2fab47404d1.tar.lz gsoc2013-epiphany-cddf3b851d38ff7f5aa72a2e9175a2fab47404d1.tar.xz gsoc2013-epiphany-cddf3b851d38ff7f5aa72a2e9175a2fab47404d1.tar.zst gsoc2013-epiphany-cddf3b851d38ff7f5aa72a2e9175a2fab47404d1.zip |
Make sure we don't show "100%" on downloads unless they're really
2006-04-03 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/MozDownload.cpp:
Make sure we don't show "100%" on downloads unless they're really
completed.
Diffstat (limited to 'embed')
-rw-r--r-- | embed/mozilla/MozDownload.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index 4591b1a90..0410ca5b0 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -554,13 +554,16 @@ MozDownload::OnProgressChange (nsIWebProgress *aWebProgress, mLastUpdate = now; - if (aMaxTotalProgress == -1) + if (aMaxTotalProgress < 0) { mPercentComplete = -1; } else { - mPercentComplete = (PRInt32)(((float)aCurTotalProgress / (float)aMaxTotalProgress) * 100.0 + 0.5); + /* Make sure not to round up, so we don't display 100% unless + * it's really finished! + */ + mPercentComplete = (PRInt32)(((float)aCurTotalProgress / (float)aMaxTotalProgress) * 100.0); } mTotalProgress = aMaxTotalProgress; |