зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
2e9add89dc
Коммит
8b34025958
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче