зеркало из https://github.com/mozilla/gecko-dev.git
Bug 910597 - Downloaded amount is always reported as unknown size. r=mbrubeck
This commit is contained in:
Родитель
a8201b4641
Коммит
ba3bbe287d
|
@ -176,7 +176,7 @@ let Util = {
|
||||||
*/
|
*/
|
||||||
getDownloadSize: function dv__getDownloadSize (aSize) {
|
getDownloadSize: function dv__getDownloadSize (aSize) {
|
||||||
let [size, units] = DownloadUtils.convertByteUnits(aSize);
|
let [size, units] = DownloadUtils.convertByteUnits(aSize);
|
||||||
if (size > 0)
|
if (aSize > 0)
|
||||||
return size + units;
|
return size + units;
|
||||||
else
|
else
|
||||||
return Strings.browser.GetStringFromName("downloadsUnknownSize");
|
return Strings.browser.GetStringFromName("downloadsUnknownSize");
|
||||||
|
|
|
@ -44,7 +44,8 @@ HelperAppLauncherDialog.prototype = {
|
||||||
|
|
||||||
_getDownloadSize: function dv__getDownloadSize (aSize) {
|
_getDownloadSize: function dv__getDownloadSize (aSize) {
|
||||||
let displaySize = DownloadUtils.convertByteUnits(aSize);
|
let displaySize = DownloadUtils.convertByteUnits(aSize);
|
||||||
if (!isNaN(displaySize[0]) && displaySize[0] > 0) // [0] is size, [1] is units
|
// displaySize[0] is formatted size, displaySize[1] is units
|
||||||
|
if (aSize > 0)
|
||||||
return displaySize.join("");
|
return displaySize.join("");
|
||||||
else {
|
else {
|
||||||
let browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
let browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче