Bug 503668: Pluggable filter lists; r=Mnyromyr, sr=Neil
authorBruno Escherl <aqualon@aquachan.de>
Sun, 19 Jul 2009 20:11:57 +0200
changeset 3091 c324b2a2bbc279ca122633f900af901d6ffc4095
parent 3090 70880f5ed4e26a5109f704be1577ea32bf62dcfe
child 3092 e06fafea89b94ddd328b717e29261a3f3ed630f8
push id2519
push usermnyromyr@tprac.de
push dateSun, 19 Jul 2009 18:14:24 +0000
treeherdercomm-central@c324b2a2bbc2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMnyromyr, Neil
bugs503668
Bug 503668: Pluggable filter lists; r=Mnyromyr, sr=Neil
suite/mailnews/mailWindowOverlay.js
suite/mailnews/search/FilterListDialog.js
--- a/suite/mailnews/mailWindowOverlay.js
+++ b/suite/mailnews/mailWindowOverlay.js
@@ -1803,29 +1803,23 @@ function MsgCanFindAgain()
 
 function MsgFilters(emailAddress, folder)
 {
     if (!folder)
       folder = GetFirstSelectedMsgFolder();
     var args;
     if (emailAddress)
     {
-      /* we have to do prefill filter so we are going to 
-         launch the filterEditor dialog
-         and prefill that with the emailAddress */
-         
-      var curFilterList = folder.getFilterList(msgWindow);
-      args = {filterList: curFilterList};
-      args.filterName = emailAddress;
+      // Prefill the filterEditor with the emailAddress.
+      args = {filterList: folder.getEditableFilterList(msgWindow), filterName: emailAddress};
       window.openDialog("chrome://messenger/content/FilterEditor.xul", "", 
                         "chrome, modal, resizable,centerscreen,dialog=yes", args);
 
-      /* if the user hits ok in the filterEditor dialog we set 
-         args.refresh=true there
-         we check this here in args to show filterList dialog */
+      // args.refresh is set to true in the filterEditor, if the user hits ok.
+      // We check this here in args to show the filterList dialog.
       if ("refresh" in args && args.refresh)
       {
          args = { refresh: true, folder: folder };
          MsgFilterList(args);
       }
     }
     else  // just launch filterList dialog
     {
--- a/suite/mailnews/search/FilterListDialog.js
+++ b/suite/mailnews/search/FilterListDialog.js
@@ -266,17 +266,17 @@ function setServer(uri)
 {
    if (uri == gCurrentServerURI)
      return;
 
    var resource = gRDF.GetResource(uri);
    var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
 
    //Calling getFilterList will detect any errors in rules.dat, backup the file, and alert the user
-   gFilterTreeView.filterList = msgFolder.getFilterList(gFilterListMsgWindow);
+   gFilterTreeView.filterList = msgFolder.getEditableFilterList(gFilterListMsgWindow);
 
    // this will get the deferred to account root folder, if server is deferred
    msgFolder = msgFolder.server.rootMsgFolder;
    var rootFolderUri = msgFolder.URI;
 
    // root the folder picker to this server
    gRunFiltersFolderPicker.setAttribute("ref", rootFolderUri);