mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
fix for bug 399460: if browser crashes or is killed (like with the Ts test) before we write out prefs, you can get two Places folders on the toolbar. r=mano, a=mconnor for M9
This commit is contained in:
parent
e0f4feb1cf
commit
6ee3eb160f
@ -320,9 +320,7 @@ function initBookmarksToolbar() {
|
||||
function initPlacesDefaultQueries() {
|
||||
var createdDefaultQueries = false;
|
||||
try {
|
||||
var prefBranch = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
createdDefaultQueries = prefBranch.getBoolPref("browser.places.createdDefaultQueries");
|
||||
createdDefaultQueries = gPrefService.getBoolPref("browser.places.createdDefaultQueries");
|
||||
} catch(ex) {}
|
||||
|
||||
if (createdDefaultQueries)
|
||||
@ -418,10 +416,12 @@ function initPlacesDefaultQueries() {
|
||||
}
|
||||
|
||||
try {
|
||||
bmsvc.runInBatchMode(callback, null)
|
||||
}
|
||||
finally {
|
||||
prefBranch.setBoolPref("browser.places.createdDefaultQueries", true);
|
||||
bmsvc.runInBatchMode(callback, null);
|
||||
} finally {
|
||||
// We need to persist this preference change, since we want to
|
||||
// check it at next app start even if the browser exits abruptly
|
||||
gPrefService.setBoolPref("browser.places.createdDefaultQueries", true);
|
||||
gPrefService.savePrefFile(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user