Bug 692392 - Advanced Search misses all search fields. r=Mnyromyr sr+a=Neil
--- 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;
}