From 68c25757f78f2d9ab35c0064dcb9be80c0b3d747 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 22 Mar 2000 21:59:40 +0000 Subject: [PATCH] only move aside the 4.x pab if we don't have the ab upgrader. --- mailnews/addrbook/src/nsDirPrefs.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/mailnews/addrbook/src/nsDirPrefs.cpp b/mailnews/addrbook/src/nsDirPrefs.cpp index 106835324bf..409729f303f 100644 --- a/mailnews/addrbook/src/nsDirPrefs.cpp +++ b/mailnews/addrbook/src/nsDirPrefs.cpp @@ -31,7 +31,7 @@ #include "nsAbBaseCID.h" #include "nsIAddrBookSession.h" #include "nsICharsetConverterManager.h" - +#include "nsIAbUpgrader.h" #include "plstr.h" #include "prmem.h" @@ -3422,9 +3422,20 @@ nsresult DIR_GetServerPreferences(nsVoidArray** list) if (version < kCurrentListVersion) { pPref->SetIntPref(PREF_LDAP_VERSION_NAME, kCurrentListVersion); - // not needed, we do ab conversion now -#if 0 - dir_ConvertToMabFileName(); + // see if we have the ab upgrader. if so, skip this, since we + // will be migrating. + nsresult rv; + nsCOMPtr abUpgrader = do_GetService(NS_AB4xUPGRADER_PROGID, &rv); + if (NS_FAILED(rv) || !abUpgrader) { +#ifdef DEBUG_sspitzer + printf("move the pab aside, since we don't have the ab upgrader\n"); +#endif + dir_ConvertToMabFileName(); + } +#ifdef DEBUG_sspitzer + else { + printf("don't touch the 4.x pab. we will migrate it\n"); + } #endif } /* Write the merged list so we get it next time we ask */