Bug 453908 - remove some left-over direct RDF uses from JavaScript code. r=aceman
authorBen Campbell <benc@thunderbird.net>
Mon, 21 Jan 2019 17:57:59 +1300
changeset 33425 a770f9f6ca81
parent 33424 043b81dfc262
child 33426 c0a224ddbe33
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs453908
Bug 453908 - remove some left-over direct RDF uses from JavaScript code. r=aceman
mail/base/content/foldersummary.js
mail/base/content/mailWidgets.xml
--- a/mail/base/content/foldersummary.js
+++ b/mail/base/content/foldersummary.js
@@ -46,19 +46,18 @@ class MozFolderSummary extends MozXULEle
       // The database for this folder may be missing (e.g. outdated/missing .msf),
       // so just skip this folder.
       return false;
     }
 
     if (folder.flags & Ci.nsMsgFolderFlags.Virtual) {
       let srchFolderUri = msgDatabase.dBFolderInfo.getCharProperty("searchFolderUri");
       let folderUris = srchFolderUri.split("|");
-      let RDF = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
       for (let uri of folderUris) {
-        let realFolder = RDF.GetResource(uri).QueryInterface(Ci.nsIMsgFolder);
+        let realFolder = MailUtils.getOrCreateFolder(uri);
         if (!realFolder.isServer) {
           folderArray.push(realFolder);
         }
       }
     } else {
       folderArray.push(folder);
     }
 
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -1942,16 +1942,18 @@
                 this.self.fire();
             },
           })
         ]]>
       </field>
       <method name="setInitialSelection">
         <body>
           <![CDATA[
+            ChromeUtils.import("resource:///modules/MailUtils.jsm", this);
+
             var view = this.tree.view;
 
             if (!view.selection.currentColumn)
               view.selection.currentColumn = this.tree.columns.getFirstColumn();
 
             view.selection.selectEventsSuppressed = true;
             for (var i = 0; i < view.rowCount; i++) {
               if (view.isContainer(i)) {
@@ -1963,18 +1965,17 @@
                     view.toggleOpenState(i);
                   }
                 }
               }
             }
             var index = -1;
             var uri = this.parentNode.getAttribute("uri");
             if (uri) {
-              var RDF = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
-              index = view.getIndexOfResource(RDF.GetResource(uri));
+              index = view.getIndexOfResource(this.MailUtils.getOrCreateFolder(uri));
             }
             view.selection.select(index);
             return index;
           ]]>
         </body>
       </method>
       <constructor>
         <![CDATA[