Bug 692392 - Advanced Search misses all search fields. r=Mnyromyr sr+a=Neil
authorJens Hatlak <jh@junetz.de>
Tue, 11 Oct 2011 20:44:20 +0200
changeset 10985 e9cb3f0268cf7fdd8f0ec60028882011ab6ff3c2
parent 10984 8d75a54332db2d9dcd4116367626cf9d1b46a824
child 10986 12a69b1421069a9ab26727eec05f41c9fcf38c2a
push id6
push userbienvenu@nventure.com
push dateWed, 16 May 2012 22:24:51 +0000
treeherdertry-comm-central@ac395aea3008 [default view] [failures only]
reviewersMnyromyr
bugs692392
Bug 692392 - Advanced Search misses all search fields. r=Mnyromyr sr+a=Neil
suite/mailnews/search/ABSearchDialog.js
--- a/suite/mailnews/search/ABSearchDialog.js
+++ b/suite/mailnews/search/ABSearchDialog.js
@@ -29,16 +29,18 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * 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 ***** */
 
+Components.utils.import("resource:///modules/mailServices.js");
+
 var searchSessionContractID = "@mozilla.org/messenger/searchSession;1";
 var gSearchSession;
 
 var nsMsgSearchScope = Components.interfaces.nsMsgSearchScope;
 var nsIMsgSearchTerm = Components.interfaces.nsIMsgSearchTerm;
 var nsMsgSearchOp = Components.interfaces.nsMsgSearchOp;
 var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
 var nsIAbDirectory = Components.interfaces.nsIAbDirectory;
@@ -47,18 +49,16 @@ var gStatusText;
 var gSearchBundle;
 var gAddressBookBundle;
 
 var gSearchStopButton;
 var gPropertiesButton;
 var gComposeButton;
 var gSearchPhoneticName = "false";
 
-var gRDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
-
 var gSearchAbViewListener = {
   onSelectionChanged: function() {
     UpdateCardView();
   },
   onCountChanged: function(total) {
     var statusText;
     switch (total) {
       case 0:
@@ -147,17 +147,17 @@ function SelectDirectory(aURI)
   if ( abPopup )
     abPopup.value = selectedAB;
 
   setSearchScope(GetScopeForDirectoryURI(selectedAB));
 }
 
 function GetScopeForDirectoryURI(aURI)
 {
-  var directory = gRDF.GetResource(aURI).QueryInterface(nsIAbDirectory);
+  var directory = MailServices.ab.getDirectory(aURI);
   var booleanAnd = gSearchBooleanRadiogroup.selectedItem.value == "and";
 
   if (directory.isRemote) {
     if (booleanAnd)
       return nsMsgSearchScope.LDAPAnd;
     else 
       return nsMsgSearchScope.LDAP;
   }