mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 19:10:36 +00:00
Prepare callsites of clearUserPref so it can go back to throwing. r=gavin
This commit is contained in:
parent
228a7c6578
commit
830e3d549b
@ -88,7 +88,8 @@ let gOpenLocationLastURL = {
|
||||
}
|
||||
},
|
||||
reset: function() {
|
||||
prefSvc.clearUserPref(LAST_URL_PREF);
|
||||
if (prefSvc.prefHasUserValue(LAST_URL_PREF))
|
||||
prefSvc.clearUserPref(LAST_URL_PREF);
|
||||
gOpenLocationLastURLData = "";
|
||||
}
|
||||
};
|
||||
|
@ -54,7 +54,8 @@ function test() {
|
||||
|
||||
function setupCleanSlate() {
|
||||
gLastOpenDirectory.reset();
|
||||
gPrefService.clearUserPref(kPrefName);
|
||||
if (gPrefService.prefHasUserValue(kPrefName))
|
||||
gPrefService.clearUserPref(kPrefName);
|
||||
}
|
||||
|
||||
setupCleanSlate();
|
||||
|
@ -97,7 +97,7 @@ let gDownloadLastDir = {
|
||||
} else {
|
||||
if (val instanceof Components.interfaces.nsIFile)
|
||||
prefSvc.setComplexValue(LAST_DIR_PREF, nsILocalFile, val);
|
||||
else
|
||||
else if (prefSvc.prefHasUserValue(LAST_DIR_PREF))
|
||||
prefSvc.clearUserPref(LAST_DIR_PREF);
|
||||
}
|
||||
}
|
||||
|
@ -2238,7 +2238,8 @@ const gLWThemeObserver = {
|
||||
}
|
||||
else if (aTopic == "lightweight-theme-changed") {
|
||||
gLWThemeToSelect = LightweightThemeManager.currentTheme;
|
||||
gPref.clearUserPref(PREF_LWTHEME_TO_SELECT);
|
||||
if (gPref.prefHasUserValue(PREF_LWTHEME_TO_SELECT))
|
||||
gPref.clearUserPref(PREF_LWTHEME_TO_SELECT);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2316,7 +2316,8 @@ ExtensionManager.prototype = {
|
||||
// If we've changed to a non-default theme make sure there is no
|
||||
// lightweight theme selected
|
||||
if (toSelect != gDefaultTheme) {
|
||||
gPref.clearUserPref(PREF_LWTHEME_TO_SELECT);
|
||||
if (gPref.prefHasUserValue(PREF_LWTHEME_TO_SELECT))
|
||||
gPref.clearUserPref(PREF_LWTHEME_TO_SELECT);
|
||||
LightweightThemeManager.currentTheme = null;
|
||||
}
|
||||
}
|
||||
@ -3311,8 +3312,8 @@ ExtensionManager.prototype = {
|
||||
// Remember the list of add-ons that were disabled this time around
|
||||
gPref.setCharPref(PREF_EM_DISABLED_ADDONS_LIST, disabledAddons.join(","));
|
||||
}
|
||||
} else {
|
||||
// Clear the disabled addons list
|
||||
} else if (gPref.prefHasUserValue(PREF_EM_DISABLED_ADDONS_LIST)) {
|
||||
// Clear the disabled addons list if necessary
|
||||
gPref.clearUserPref(PREF_EM_DISABLED_ADDONS_LIST);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user