Backed out changeset 6eb853899d58 / bug 607366 due to test failures on Mac.
authorMark Banner <bugzilla@standard8.plus.com>
Fri, 29 Oct 2010 18:43:18 +0100
changeset 6614 6ed4dbcb748f77be9f830a691606a303595bee11
parent 6613 e8e2938b6e53b707c549b8dc8163ee9bc4a45dd9
child 6615 e63657b53b57876ecb6f7648298a841333b3de2c
push idunknown
push userunknown
push dateunknown
bugs607366
backs out6eb853899d58440635fbd1c0e4bdefb4ed5ffaaf
Backed out changeset 6eb853899d58 / bug 607366 due to test failures on Mac.
mail/base/content/featureConfigurators/autosync.js
--- a/mail/base/content/featureConfigurators/autosync.js
+++ b/mail/base/content/featureConfigurators/autosync.js
@@ -36,21 +36,20 @@
  * ***** END LICENSE BLOCK ***** */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource:///modules/errUtils.js");
 Cu.import("resource:///modules/iteratorUtils.jsm");
+Cu.import("resource://gre/modules/DownloadUtils.jsm");
 
 var gPrefBranch = Cc["@mozilla.org/preferences-service;1"]
                     .getService(Ci.nsIPrefBranch);
-var gMessenger = Cc["@mozilla.org/messenger;1"]
-                   .createInstance(Ci.nsIMessenger);
 
 
 var AutoSyncConfigurator = {
   /**
    * Update the various text spans and radio buttons with the values we
    * calculate from the IMAP folders.
    */
   updateStatus: function as_updateStatus() {
@@ -85,19 +84,23 @@ var AutoSyncConfigurator = {
           filePath.initWithPath(filePath.path + ".msf");
           if (filePath.exists())
             currentSize += filePath.fileSize;
           estimatedSize += folder.sizeOnDisk;
         }
       }
       sizeDifference = estimatedSize - currentSize;
 
-      $("#free-space").text(gMessenger.formatFileSize(freeSpace));
-      $("#current-size").text(gMessenger.formatFileSize(currentSize));
-      $("#size-difference").text(gMessenger.formatFileSize(sizeDifference));
+      let formatSize = function as_formatSize(aNumBytes) {
+        let [size, unit] = DownloadUtils.convertByteUnits(aNumBytes);
+        return size + " " + unit;
+      }
+      $("#free-space").text(formatSize(freeSpace));
+      $("#current-size").text(formatSize(currentSize));
+      $("#size-difference").text(formatSize(sizeDifference));
 
       // If we will leave <50MB or take up >50% of free space then warn.
       let newFreeSpace = freeSpace - sizeDifference;
       if (newFreeSpace < (1024 * 1024 * 50) || newFreeSpace < (freeSpace / 2))
         $("#disk-space-warning").show();
       else
         $("#disk-space-warning").hide();