зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
95fa778e72
Коммит
00afed97ec
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче