From 9cca01713c1e76e9d148027f9d3c583bfe9aa29c Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Fri, 19 Oct 2001 21:32:07 +0000 Subject: [PATCH] Fix bug # 49142: speed up bookmarks menu creation on Mac. r=pink, sr=sfraser. --- xpfe/components/bookmarks/src/nsBookmarksService.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/xpfe/components/bookmarks/src/nsBookmarksService.cpp index e386ded7af4..317d7e32153 100644 --- a/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -3765,6 +3765,8 @@ nsBookmarksService::importBookmarks(nsISupportsArray *aArguments) // read 'em in BookmarkParser parser; parser.Init(&fileSpec, mInner, nsAutoString(), PR_TRUE); + + // Note: can't Begin|EndUpdateBatch() this as notifications are required parser.Parse(newBookmarkFolder, kNC_Bookmark); return(NS_OK); @@ -4027,7 +4029,9 @@ nsBookmarksService::ReadFavorites() { BookmarkParser parser; parser.Init(&ieFavoritesFile, mInner, nsAutoString()); + BeginUpdateBatch(this); parser.Parse(kNC_IEFavoritesRoot, kNC_IEFavorite); + EndUpdateBatch(this); nsCOMPtr ieTitleLiteral; rv = gRDF->GetLiteral(ieTitle.get(), getter_AddRefs(ieTitleLiteral)); @@ -4136,7 +4140,9 @@ nsBookmarksService::ReadBookmarks() parser.SetIEFavoritesRoot(cstringNetPositiveURL); #endif + BeginUpdateBatch(this); parser.Parse(kNC_BookmarksRoot, kNC_Bookmark); + EndUpdateBatch(this); mBookmarksAvailable = PR_TRUE; PRBool foundPTFolder = PR_FALSE;