From 2ddb3ddf5e0cd21f7ea96407154f1a01f1095a39 Mon Sep 17 00:00:00 2001 From: "bugzilla%standard8.demon.co.uk" Date: Wed, 11 Jul 2007 15:28:51 +0000 Subject: [PATCH] Bug 387557 Rename nsIAbDirFactory::CreateDirectory to nsIAbDirFactory::GetDirectories. r/sr=bienvenu --- mailnews/addrbook/build/nsAbFactory.cpp | 3 --- mailnews/addrbook/public/nsIAbDirFactory.idl | 20 +++++++------------ mailnews/addrbook/src/nsAbBSDirectory.cpp | 2 +- mailnews/addrbook/src/nsAbLDAPDirFactory.cpp | 10 +--------- mailnews/addrbook/src/nsAbMDBDirFactory.cpp | 5 +++-- mailnews/addrbook/src/nsAbOSXDirFactory.cpp | 4 ++-- .../addrbook/src/nsAbOutlookDirFactory.cpp | 14 +++---------- mailnews/build/nsMailModule.cpp | 3 --- 8 files changed, 17 insertions(+), 44 deletions(-) diff --git a/mailnews/addrbook/build/nsAbFactory.cpp b/mailnews/addrbook/build/nsAbFactory.cpp index 1fb67cd4f1b..a77c7fffa05 100644 --- a/mailnews/addrbook/build/nsAbFactory.cpp +++ b/mailnews/addrbook/build/nsAbFactory.cpp @@ -88,9 +88,6 @@ #if defined(XP_WIN) && !defined(__MINGW32__) #include "nsAbOutlookDirFactory.h" -// These two cause windows.h to be included, if not placed after *DirFactory.h -// then this can cause problems with CreateDirectory not being -// defined. #include "nsAbOutlookDirectory.h" #include "nsAbOutlookCard.h" #endif diff --git a/mailnews/addrbook/public/nsIAbDirFactory.idl b/mailnews/addrbook/public/nsIAbDirFactory.idl index 037d80d8bae..6427b25e49b 100644 --- a/mailnews/addrbook/public/nsIAbDirFactory.idl +++ b/mailnews/addrbook/public/nsIAbDirFactory.idl @@ -44,24 +44,18 @@ interface nsIAbDirectory; interface nsIAbDirectoryProperties; -[scriptable, uuid(C2308606-1DD1-11B2-87D4-85FCA9B1DC08)] +[scriptable, uuid(19125c19-4582-420d-894c-cb3cf10b9eab)] interface nsIAbDirFactory : nsISupports { /** - * Instantiate new top level address book - * directories given some properties. - * More than one directory may be - * returned depending on the implementation - * and integration with the associated address book - * sources + * Get a top level address book directory and sub directories, given some + * properties. * - * @param aProperties - * nsIAbDirectoryProperties with the properties - * @return - * Enumeration of nsIAbDirectory - * interfaces + * @param aProperties nsIAbDirectoryProperties with the properties + * + * @return Enumeration of nsIAbDirectory interfaces */ - nsISimpleEnumerator createDirectory(in nsIAbDirectoryProperties aProperties); + nsISimpleEnumerator getDirectories(in nsIAbDirectoryProperties aProperties); /** * Delete a top level address book directory diff --git a/mailnews/addrbook/src/nsAbBSDirectory.cpp b/mailnews/addrbook/src/nsAbBSDirectory.cpp index da6298996ce..9dace9dd4a0 100644 --- a/mailnews/addrbook/src/nsAbBSDirectory.cpp +++ b/mailnews/addrbook/src/nsAbBSDirectory.cpp @@ -96,7 +96,7 @@ nsresult nsAbBSDirectory::CreateDirectoriesFromFactory( // Create the directories nsCOMPtr newDirEnumerator; - rv = dirFactory->CreateDirectory(aProperties, getter_AddRefs(newDirEnumerator)); + rv = dirFactory->GetDirectories(aProperties, getter_AddRefs(newDirEnumerator)); NS_ENSURE_SUCCESS (rv, rv); // Enumerate through the directories adding them diff --git a/mailnews/addrbook/src/nsAbLDAPDirFactory.cpp b/mailnews/addrbook/src/nsAbLDAPDirFactory.cpp index a7a15a909d4..22f0a308747 100644 --- a/mailnews/addrbook/src/nsAbLDAPDirFactory.cpp +++ b/mailnews/addrbook/src/nsAbLDAPDirFactory.cpp @@ -62,7 +62,7 @@ nsAbLDAPDirFactory::~nsAbLDAPDirFactory() { } -NS_IMETHODIMP nsAbLDAPDirFactory::CreateDirectory(nsIAbDirectoryProperties *aProperties, +NS_IMETHODIMP nsAbLDAPDirFactory::GetDirectories(nsIAbDirectoryProperties *aProperties, nsISimpleEnumerator **aDirectories) { NS_ENSURE_ARG_POINTER(aProperties); @@ -72,7 +72,6 @@ NS_IMETHODIMP nsAbLDAPDirFactory::CreateDirectory(nsIAbDirectoryProperties *aPro nsCString uri; nsAutoString description; - nsCString prefName; rv = aProperties->GetDescription(description); NS_ENSURE_SUCCESS(rv, rv); @@ -80,14 +79,10 @@ NS_IMETHODIMP nsAbLDAPDirFactory::CreateDirectory(nsIAbDirectoryProperties *aPro rv = aProperties->GetURI(getter_Copies(uri)); NS_ENSURE_SUCCESS(rv, rv); - rv = aProperties->GetPrefName(getter_Copies(prefName)); - NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr rdf = do_GetService (NS_RDF_CONTRACTID "/rdf-service;1", &rv); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr resource; - if ((strncmp(uri.get(), "ldap:", 5) == 0) || (strncmp(uri.get(), "ldaps:", 6) == 0)) { nsCString prefName; @@ -123,9 +118,6 @@ NS_IMETHODIMP nsAbLDAPDirFactory::CreateDirectory(nsIAbDirectoryProperties *aPro nsCOMPtr directory(do_QueryInterface(resource, &rv)); NS_ENSURE_SUCCESS(rv, rv); - rv = directory->SetDirPrefId(prefName); - NS_ENSURE_SUCCESS(rv, rv); - return NS_NewSingletonEnumerator(aDirectories, directory); } diff --git a/mailnews/addrbook/src/nsAbMDBDirFactory.cpp b/mailnews/addrbook/src/nsAbMDBDirFactory.cpp index 932b0b40d95..8ad9d50a409 100644 --- a/mailnews/addrbook/src/nsAbMDBDirFactory.cpp +++ b/mailnews/addrbook/src/nsAbMDBDirFactory.cpp @@ -101,8 +101,9 @@ static nsresult RemoveMailListDBListeners (nsIAddrDatabase* database, nsIAbDirec return NS_OK; } -NS_IMETHODIMP nsAbMDBDirFactory::CreateDirectory(nsIAbDirectoryProperties *aProperties, - nsISimpleEnumerator **_retval) +NS_IMETHODIMP nsAbMDBDirFactory::GetDirectories( + nsIAbDirectoryProperties *aProperties, + nsISimpleEnumerator **_retval) { NS_ENSURE_ARG_POINTER(aProperties); NS_ENSURE_ARG_POINTER(_retval); diff --git a/mailnews/addrbook/src/nsAbOSXDirFactory.cpp b/mailnews/addrbook/src/nsAbOSXDirFactory.cpp index d18adfb7575..0c5445696cf 100644 --- a/mailnews/addrbook/src/nsAbOSXDirFactory.cpp +++ b/mailnews/addrbook/src/nsAbOSXDirFactory.cpp @@ -50,8 +50,8 @@ NS_IMPL_ISUPPORTS1(nsAbOSXDirFactory, nsIAbDirFactory) NS_IMETHODIMP -nsAbOSXDirFactory::CreateDirectory(nsIAbDirectoryProperties *aProperties, - nsISimpleEnumerator **aDirectories) +nsAbOSXDirFactory::GetDirectories(nsIAbDirectoryProperties *aProperties, + nsISimpleEnumerator **aDirectories) { NS_ENSURE_ARG_POINTER(aProperties); NS_ENSURE_ARG_POINTER(aDirectories); diff --git a/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp b/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp index d69f1607424..052577543c7 100644 --- a/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp +++ b/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp @@ -58,15 +58,6 @@ static PRLogModuleInfo* gAbOutlookDirFactoryLog #define PRINTF(args) PR_LOG(nsAbOutlookDirFactoryLog, PR_LOG_DEBUG, args) -// In case someone is wondering WHY I have to undefine CreateDirectory, -// it's because the windows files winbase.h and wininet.h define this -// to CreateDirectoryA/W (for reasons best left unknown) and with the -// MAPI stuff, I end up including this, which wreaks havoc on my symbol -// table. -#ifdef CreateDirectory -# undef CreateDirectory -#endif // CreateDirectory - NS_IMPL_ISUPPORTS1(nsAbOutlookDirFactory, nsIAbDirFactory) nsAbOutlookDirFactory::nsAbOutlookDirFactory(void) @@ -94,8 +85,9 @@ static nsresult parseProperties(nsIAbDirectoryProperties *aProperties, nsAbWinTy return NS_OK; } -NS_IMETHODIMP nsAbOutlookDirFactory::CreateDirectory(nsIAbDirectoryProperties *aProperties, - nsISimpleEnumerator **aDirectories) +NS_IMETHODIMP nsAbOutlookDirFactory::GetDirectories( + nsIAbDirectoryProperties *aProperties, + nsISimpleEnumerator **aDirectories) { NS_ENSURE_ARG_POINTER(aProperties); NS_ENSURE_ARG_POINTER(aDirectories); diff --git a/mailnews/build/nsMailModule.cpp b/mailnews/build/nsMailModule.cpp index a04351a5c94..1cd25306d53 100644 --- a/mailnews/build/nsMailModule.cpp +++ b/mailnews/build/nsMailModule.cpp @@ -164,9 +164,6 @@ #if defined(XP_WIN) && !defined(__MINGW32__) #include "nsAbOutlookDirFactory.h" -// These two cause windows.h to be included, if not placed after *DirFactory.h -// then this can cause problems with CreateDirectory not being -// defined. #include "nsAbOutlookDirectory.h" #include "nsAbOutlookCard.h" #endif