From aa575310866e85c1b3dec4e0bd46e035d2eb3963 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Sat, 18 Sep 1999 19:32:52 +0000 Subject: [PATCH] make it so the user has there 4.x bookmarks after migration. --- profile/pref-migrator/src/nsPrefMigration.cpp | 2 +- profile/src/nsProfile.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/profile/pref-migrator/src/nsPrefMigration.cpp b/profile/pref-migrator/src/nsPrefMigration.cpp index 465558abb2f..adf91b0f2ee 100644 --- a/profile/pref-migrator/src/nsPrefMigration.cpp +++ b/profile/pref-migrator/src/nsPrefMigration.cpp @@ -918,7 +918,7 @@ nsPrefMigration::DoSpecialUpdates(nsFileSpec profilePath) // rename the bookmarks file, but only if we need to. rv = Rename4xFileAfterMigration(profilePath,BOOKMARKS_FILE_NAME_IN_4x,BOOKMARKS_FILE_NAME_IN_5x); if (NS_FAILED(rv)) return rv; - + #ifdef MAIL_FILTER_FILE_NAME_SUFFIX_IN_4x rv = RenameAndMoveFilterFiles(profilePath); if (NS_FAILED(rv)) return rv; diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index f940b2ab3f4..dfbd04dcb78 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -86,6 +86,8 @@ #include "nsIServiceManager.h" #include "nsCOMPtr.h" +#include "nsIBookmarksService.h" + #define _MAX_LENGTH 256 #define _MAX_NUM_PROFILES 50 @@ -123,7 +125,7 @@ static PRBool renameCurrProfile = PR_FALSE; // IID and CIDs of all the services needed static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID); - +static NS_DEFINE_CID(kBookmarksCID, NS_BOOKMARKS_SERVICE_CID); static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID); static NS_DEFINE_CID(kRegistryCID, NS_REGISTRY_CID); @@ -1932,6 +1934,12 @@ NS_IMETHODIMP nsProfile::StartCommunicator(const char* profileName) } + // we need to re-read the bookmarks here, other wise the user + // won't have there 4.x bookmarks until after they exit and come back + NS_WITH_SERVICE(nsIBookmarksService, bookmarks, kBookmarksCID, &rv); + if (NS_FAILED(rv)) return rv; + rv = bookmarks->ReadBookmarks(); + return rv; }