Backout Bug 733802 - changesets 29d89350dce1 / c20698efdd88 due to unit test bustage
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 20 Mar 2012 20:12:47 +0000
changeset 9695 15769b1a16d00199402730a797fe4c8edfddcdc7
parent 9694 342f2874aa7091fb16fcd77516cc0ddada72b7be
child 9696 b001a665472df2dfd72376a882e1456d0882d3f2
push idunknown
push userunknown
push dateunknown
bugs733802
Backout Bug 733802 - changesets 29d89350dce1 / c20698efdd88 due to unit test bustage
mail/components/mailComponents.manifest
mail/components/webSearchProvider.js
--- a/mail/components/mailComponents.manifest
+++ b/mail/components/mailComponents.manifest
@@ -14,9 +14,9 @@ contract @mozilla.org/uriloader/content-
 contract @mozilla.org/uriloader/content-handler;1?type=text/plain {1c73f03a-b817-4640-b984-18c3478a9ae3}
 
 component {eb239c82-fac9-431e-98d7-11cacd0f71b8} mailGlue.js
 contract @mozilla.org/mail/mailglue;1 {eb239c82-fac9-431e-98d7-11cacd0f71b8}
 category app-startup MailGlue service,@mozilla.org/mail/mailglue;1
 
 component {76a80bff-8c3f-4b78-ad2c-80099e35375d} webSearchProvider.js
 contract @mozilla.org/mail/web-search-provider;1 {76a80bff-8c3f-4b78-ad2c-80099e35375d}
-category xpcom-directory-providers web-search-directory-provider @mozilla.org/mail/web-search-provider;1
+category xpcom-directory-providers web-search-directory-provider service,@mozilla.org/mail/web-search-provider;1
--- a/mail/components/webSearchProvider.js
+++ b/mail/components/webSearchProvider.js
@@ -32,54 +32,41 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 const NS_APP_SEARCH_DIR_LIST = "SrchPluginsDL";
 const NS_APP_USER_SEARCH_DIR = "UsrSrchPlugns";
 const NS_APP_SEARCH_DIR = "SrchPlugns";
-const NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProcD";
+const NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProdD";
 const XRE_EXTENSIONS_DIR_LIST = "XREExtDL";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
-const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 function AppendingEnumerator(base, append) {
   this.base = base;
   this.append = append;
-  this.next = null;
-
-  this.getNext();
 }
 
 AppendingEnumerator.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISimpleEnumerator]),
 
   hasMoreElements: function() {
-    return this.next != null;
+    return this.base.hasMoreElements();
   },
 
   getNext: function() {
-    let res = this.next;
-    let next = null;
-
-    while (this.base.hasMoreElements() && !next) {
-      let file = this.base.getNext().QueryInterface(Ci.nsIFile);
-      file.append(this.append);
-      if (file.exists())
-        next = file;
-    }
-
-    this.next = next;
-    return res;
+    let file = this.base.getNext().QueryInterface(Ci.nsIFile);
+    file.append(this.append);
+    return file;
   },
 };
 
 function UnionEnumerator(first, second) {
   this.first = first;
   this.second = second;
 }
 
@@ -102,17 +89,17 @@ UnionEnumerator.prototype = {
 function WebSearchProvider() {}
 WebSearchProvider.prototype = {
   classDescription: "Web Search Provider",
   classID: Components.ID("{76a80bff-8c3f-4b78-ad2c-80099e35375d}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider,
                                          Ci.nsIDirectoryServiceProvider2]),
 
   getFile: function() {
-    return null;
+    throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
   },
 
   getFiles: function(prop) {
     if (prop != NS_APP_SEARCH_DIR_LIST)
       return null;
 
     /**
      * We want to preserve the following order, since the search service loads
@@ -172,16 +159,16 @@ WebSearchProvider.prototype = {
         array.appendElement(defLocalePlugins, false);
     }
     catch(e) {}
   },
 
   appendFileKey: function(key, array) {
     try {
       let file = Services.dirsvc.get(key, Ci.nsIFile);
-      if (file.exists())
+      if (!file.exists())
         array.appendElement(file, false);
     }
     catch(e) {}
   },
 };
 
 const NSGetFactory = XPCOMUtils.generateNSGetFactory([WebSearchProvider]);