backing out fix for bug #406094 until dietrich's backout clears so that we can clearly measure that this change did not impact Ts / Txul. s=dmose

This commit is contained in:
sspitzer%mozilla.org 2007-12-04 20:09:53 +00:00
Родитель 79b5028b16
Коммит 3efe210416
2 изменённых файлов: 11 добавлений и 28 удалений

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

@ -1702,20 +1702,17 @@ var PlacesUtils = {
var allBookmarksId; var allBookmarksId;
try { try {
leftPaneRoot = prefs.getIntPref("browser.places.leftPaneFolderId"); leftPaneRoot = prefs.getIntPref("browser.places.leftPaneFolderId");
// if the pref is set to -1 then we must create a new root because we have a new places.sqlite // Build the leftPaneQueries Map
if (leftPaneRoot != -1) { delete this.leftPaneQueries;
// Build the leftPaneQueries Map this.leftPaneQueries = {};
delete this.leftPaneQueries; var items = this.annotations.getItemsWithAnnotation(ORGANIZER_QUERY_ANNO, { });
this.leftPaneQueries = {}; for (var i=0; i < items.length; i++) {
var items = this.annotations.getItemsWithAnnotation(ORGANIZER_QUERY_ANNO, { }); var queryName = this.annotations
for (var i=0; i < items.length; i++) { .getItemAnnotation(items[i], ORGANIZER_QUERY_ANNO);
var queryName = this.annotations this.leftPaneQueries[queryName] = items[i];
.getItemAnnotation(items[i], ORGANIZER_QUERY_ANNO);
this.leftPaneQueries[queryName] = items[i];
}
delete this.leftPaneFolderId;
return this.leftPaneFolderId = leftPaneRoot;
} }
delete this.leftPaneFolderId;
return this.leftPaneFolderId = leftPaneRoot;
} }
catch (ex) { } catch (ex) { }

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

@ -110,10 +110,7 @@
#define PREF_AUTOCOMPLETE_ENABLED "urlbar.autocomplete.enabled" #define PREF_AUTOCOMPLETE_ENABLED "urlbar.autocomplete.enabled"
#define PREF_DB_CACHE_PERCENTAGE "history_cache_percentage" #define PREF_DB_CACHE_PERCENTAGE "history_cache_percentage"
#define PREF_BROWSER_IMPORT_BOOKMARKS "browser.places.importBookmarksHTML" #define PREF_BROWSER_IMPORT_BOOKMARKS "browser.places.importBookmarksHTML"
#define PREF_BROWSER_IMPORT_DEFAULTS "browser.places.importDefaults"
#define PREF_BROWSER_CREATEDSMARTBOOKMARKS "browser.places.createdSmartBookmarks"
#define PREF_BROWSER_LEFTPANEFOLDERID "browser.places.leftPaneFolderId"
// Default (integer) value of PREF_DB_CACHE_PERCENTAGE from 0-100 // Default (integer) value of PREF_DB_CACHE_PERCENTAGE from 0-100
// This is 6% of machine memory, giving 15MB for a user with 256MB of memory. // This is 6% of machine memory, giving 15MB for a user with 256MB of memory.
// The most that will be used is the size of the DB file. Normal history sizes // The most that will be used is the size of the DB file. Normal history sizes
@ -505,17 +502,6 @@ nsNavHistory::InitDBFile(PRBool aForceInit)
if (prefs) { if (prefs) {
rv = prefs->SetBoolPref(PREF_BROWSER_IMPORT_BOOKMARKS, PR_TRUE); rv = prefs->SetBoolPref(PREF_BROWSER_IMPORT_BOOKMARKS, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
rv = prefs->SetBoolPref(PREF_BROWSER_IMPORT_DEFAULTS, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);
// if the places.sqlite gets deleted/corrupted the queries should be created again
rv = prefs->SetBoolPref(PREF_BROWSER_CREATEDSMARTBOOKMARKS, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
// we must create a new Organizer left pane folder root, the old will not be valid anymore
rv = prefs->SetIntPref(PREF_BROWSER_LEFTPANEFOLDERID, -1);
NS_ENSURE_SUCCESS(rv, rv);
} }
} }