fix bit-rotting of osx address book code, so that it compiles and works again, NPOB

This commit is contained in:
bienvenu%nventure.com 2007-08-04 21:09:11 +00:00
Родитель 36747d97d3
Коммит 525206c83d
3 изменённых файлов: 17 добавлений и 12 удалений

Просмотреть файл

@ -52,11 +52,13 @@
class nsIAbOSXCard : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IABOSXCARD_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IABOSXCARD_IID)
virtual nsresult Update(PRBool aNotify) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAbOSXCard, NS_IABOSXCARD_IID)
class nsAbOSXCard : public nsRDFResource,
public nsAbCardProperty,
public nsIAbOSXCard

Просмотреть файл

@ -59,6 +59,7 @@ nsAbOSXDirFactory::GetDirectories(const nsAString &aDirName,
*aDirectories = nsnull;
nsresult rv;
nsCOMPtr<nsIRDFService> rdf =
do_GetService(NS_RDF_CONTRACTID "/rdf-service;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
@ -76,7 +77,7 @@ nsAbOSXDirFactory::GetDirectories(const nsAString &aDirName,
rv = osxDirectory->AssertChildNodes();
NS_ENSURE_SUCCESS(rv, rv);
return NS_NewSingletonEnumerator(aDirectories, directory);
return NS_NewSingletonEnumerator(aDirectories, osxDirectory);
}
// No actual deletion, since you cannot create the address books from Mozilla.

Просмотреть файл

@ -464,8 +464,10 @@ nsAbOSXDirectory::Init(const char *aUri)
NS_ASSERTION([card isKindOfClass:[ABGroup class]], "Huh.");
m_IsMailList = PR_TRUE;
AppendToString([card valueForProperty:kABGroupNameProperty], m_DirName);
AppendToString([card valueForProperty:kABGroupNameProperty], m_ListDirName);
}
else
m_DirPrefId.AssignLiteral("ldap_2.servers.osx");
return NS_OK;
}
@ -559,13 +561,13 @@ nsAbOSXDirectory::Update()
card = (ABRecord*)[addressBook recordForUniqueId:[NSString stringWithUTF8String:nsCAutoString(Substring(mURINoQuery, 21)).get()]];
NSString * stringValue = [card valueForProperty:kABGroupNameProperty];
if (![stringValue isEqualToString:WrapString(m_DirName)]) {
nsAutoString oldValue(m_DirName);
AssignToString(stringValue, m_DirName);
if (![stringValue isEqualToString:WrapString(m_ListDirName)]) {
nsAutoString oldValue(m_ListDirName);
AssignToString(stringValue, m_ListDirName);
nsISupports *supports =
NS_ISUPPORTS_CAST(nsAbDirectoryRDFResource*, this);
abSession->NotifyItemPropertyChanged(supports, "DirName",
oldValue.get(), m_DirName.get());
oldValue.get(), m_ListDirName.get());
}
if (groups) {
@ -580,7 +582,7 @@ nsAbOSXDirectory::Update()
do_QueryInterface(directory);
nsCAutoString uri;
osxDirectory->GetURI(uri);
directory->GetURI(uri);
uri.Cut(0, 21);
NSString *uid = [NSString stringWithUTF8String:uri.get()];
@ -716,7 +718,7 @@ nsAbOSXDirectory::GetChildNodes(nsISimpleEnumerator **aNodes)
}
NS_IMETHODIMP
nsAbOSXDirectory::GetChildCards(nsIEnumerator **aCards)
nsAbOSXDirectory::GetChildCards(nsISimpleEnumerator **aCards)
{
NS_ENSURE_ARG_POINTER(aCards);
@ -774,7 +776,7 @@ nsAbOSXDirectory::GetChildCards(nsIEnumerator **aCards)
mCardList.PutEntry(card);
}
return GetEnumerator(cardList, aCards);
return NS_NewArrayEnumerator(aCards, cardList);
}
NS_IMETHODIMP
@ -829,7 +831,7 @@ nsAbOSXDirectory::OnSearchFoundCard(nsIAbCard *aCard)
nsresult
nsAbOSXDirectory::FallbackSearch(nsIAbBooleanExpression *aExpression,
nsIEnumerator **aCards)
nsISimpleEnumerator **aCards)
{
nsresult rv;
@ -893,5 +895,5 @@ nsAbOSXDirectory::FallbackSearch(nsIAbBooleanExpression *aExpression,
rv = queryProxy->DoQuery(arguments, queryListener, -1, 0, &context);
NS_ENSURE_SUCCESS(rv, rv);
return GetEnumerator(m_AddressList, aCards);
return NS_NewArrayEnumerator(aCards, m_AddressList);
}