Bug 392793 - invalid (negative) progress percentage displayed in the window title for certain downloads p=Ryan Jones <sciguyryan@gmail.com> r=sdwilsh

This commit is contained in:
asqueella@gmail.com 2007-08-25 13:39:33 -07:00
Родитель 95fa778e72
Коммит 00afed97ec
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -88,7 +88,7 @@ function createDownloadItem(aID, aFile, aTarget, aURI, aState,
dl.setAttribute("type", "download");
dl.setAttribute("id", "dl" + aID);
dl.setAttribute("dlid", aID);
dl.setAttribute("image", "moz-icon://" + aFile + "?size=32");
dl.setAttribute("image", "moz-icon://" + aFile + "?size=32");
dl.setAttribute("file", aFile);
dl.setAttribute("target", aTarget);
dl.setAttribute("uri", aURI);
@ -381,8 +381,10 @@ function onUpdateProgress()
while (dls.hasMoreElements()) {
let dl = dls.getNext();
dl.QueryInterface(Ci.nsIDownload);
mean += dl.amountTransferred;
base += dl.size;
if (dl.percentComplete < 100 && dl.size > 0) {
mean += dl.amountTransferred;
base += dl.size;
}
numActiveDownloads++;
}