Bug 419315 - All bookmarks lost after using "Restore all user preferences" (r=mano, re-land, testing perf)

This commit is contained in:
dietrich@mozilla.com 2008-03-26 22:00:47 -07:00
Родитель 56b0de490d
Коммит cf86eefebb
2 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -640,12 +640,6 @@ pref("browser.sessionstore.max_tabs_undo", 10);
// allow META refresh by default
pref("accessibility.blockautorefresh", false);
// import bookmarks.html into Places bookmarks
pref("browser.places.importBookmarksHTML", true);
// if false, will add the "Smart Bookmarks" folder to the personal toolbar
pref("browser.places.createdSmartBookmarks", false);
// If true, will migrate uri post-data annotations to
// bookmark post-data annotations (bug 398914)
// XXX to be removed after beta 2 (bug 391419)

Просмотреть файл

@ -401,6 +401,14 @@ BrowserGlue.prototype = {
} catch(ex) {}
if (!importBookmarks) {
+ /**
+ * These prefs are set by the backend services upon creation (or recreation)
+ * of the Places db:
+ * - browser.places.importBookmarksHTML
+ * Set to false by the history service to indicate we need to re-import.
+ * - browser.places.createdSmartBookmarks
+ * Set during HTML import to indicate that the queries were created.
+ */
// Call it here for Fx3 profiles created before the Places folder
// has been added, otherwise it's called during import.
this.ensurePlacesDefaultQueriesInitialized();
@ -417,6 +425,9 @@ BrowserGlue.prototype = {
else {
// if there's no json backup use bookmarks.html
// ensurePlacesDefaultQueriesInitialized() is called by import.
prefBranch.setBoolPref("browser.places.createdSmartBookmarks", false);
var dirService = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
var bookmarksFile = dirService.get("BMarks", Ci.nsILocalFile);