Bug 675514 - "folder name comparison when deciding whether to include account name should be case-insensitive?" [r=dbienvenu ui-r=jik]
authorJonathan Kamens <jik>
Thu, 04 Aug 2011 09:11:00 -0400
changeset 8268 aa8e3dd28126cbf653c0a7ff26b43fbc5efcb732
parent 8267 53a2ab49111744ae0d4b9a1b9129ab642dcfa3ec
child 8269 d745126176278c7c04bfcc90b30568f36f45ca92
push id6360
push userCallek@gmail.com
push dateTue, 09 Aug 2011 10:03:21 +0000
treeherdercomm-central@3b67c67a2ab0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbienvenu, jik
bugs675514
Bug 675514 - "folder name comparison when deciding whether to include account name should be case-insensitive?" [r=dbienvenu ui-r=jik]
mail/base/content/folderPane.js
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -1,8 +1,9 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -1324,23 +1325,26 @@ let gFolderTreeView = {
             faves.push(new ftvItem(folder));
         }
 
         // There are no children in this view!
         // And we want to display the account name to distinguish folders w/
         // the same name. (only for folders with duplicated names)
         let uniqueNames = new Object();
         for each (let item in faves) {
+          let name = item._folder.abbreviatedName.toLowerCase();
           item.__defineGetter__("children", function() []);
-          if (!uniqueNames[item._folder.abbreviatedName])
-            uniqueNames[item._folder.abbreviatedName] = 0;
-          uniqueNames[item._folder.abbreviatedName]++;
+          if (!uniqueNames[name])
+            uniqueNames[name] = 0;
+          uniqueNames[name]++;
         }
-        for each (let item in faves)
-          item.addServerName = (uniqueNames[item._folder.abbreviatedName] > 1) ? true : false;
+        for each (let item in faves) {
+          let name = item._folder.abbreviatedName.toLowerCase();
+          item.addServerName = (uniqueNames[name] > 1) ? true : false;
+        }
         sortFolderItems(faves);
         return faves;
       },
 
       getParentOfFolder: function ftv_unread_getParentOfFolder(aFolder) {
         // This is a flat view, so no folders have parents.
         return null;
       }