From c2c60cba11647ef267e2c6a757906bb8ffa0765b 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 106835324bf7..409729f303f0 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 */