Bug 471850 - more than one 'Most Visisted' tabs in toolbar when importing bookmarks.html created by autoExportHTML, r=dietrich
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -561,17 +561,28 @@ BrowserGlue.prototype = {
if (!importBookmarks) {
// Call it here for Fx3 profiles created before the Places folder
// has been added, otherwise it's called during import.
this.ensurePlacesDefaultQueriesInitialized();
}
else {
// ensurePlacesDefaultQueriesInitialized() is called by import.
- this._prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
+ // Don't try to recreate smart bookmarks if autoExportHTML is true or
+ // smart bookmarks are disabled.
+ var autoExportHTML = false;
+ try {
+ autoExportHTML = this._prefs.getBoolPref("browser.bookmarks.autoExportHTML");
+ } catch(ex) {}
+ var smartBookmarksVersion = 0;
+ try {
+ smartBookmarksVersion = this._prefs.getIntPref("browser.places.smartBookmarksVersion");
+ } catch(ex) {}
+ if (!autoExportHTML && smartBookmarksVersion != -1)
+ this._prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
// Get bookmarks.html file location
var dirService = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
var bookmarksFile = null;
if (restoreDefaultBookmarks) {
// User wants to restore bookmarks.html file from default profile folder