From f26c23ea846f98e6069451a5c4274c9c5b4dcfec Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Thu, 22 Jul 1999 09:08:44 +0000 Subject: [PATCH] When looking for a bookmark file, first try PROFILE_DIR/bookmarks.html and if that doesn't exist, then try PROFILE_DIR/bookmark.htm Do this because of differences in names on various platforms in older browser versions, when importing bookmarks into this version leaves us with naming differences. We don't want to force the import process to change the bookmark filename, as that might break third party applications which mess with the bookmark file and expect the old name. --- .../bookmarks/src/nsBookmarksService.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/xpfe/components/bookmarks/src/nsBookmarksService.cpp index 85155774a999..99eca41f578f 100644 --- a/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -1874,8 +1874,23 @@ nsBookmarksService::GetBookmarksFile(nsFileSpec* aResult) *aResult += "bookmarks.html"; + // Note: first try "bookmarks.html" and, if that doesn't exist, + // fallback to trying "bookmark.htm". Do this due to older + // versions of the browser where the name is different per + // platform. if (! aResult->Exists()) - rv = NS_ERROR_FAILURE; + { + // XXX should we NS_RELEASE(*aResult) ??? + + rv = profile->GetCurrentProfileDir(aResult); + if (NS_FAILED(rv)) break; + *aResult += "bookmark.htm"; + + if (! aResult->Exists()) + { + rv = NS_ERROR_FAILURE; + } + } } while (0); #ifdef DEBUG