Prepare callsites of clearUserPref so it can go back to throwing. r=gavin

This commit is contained in:
Gijs Kruitbosch 2009-10-28 22:44:15 +01:00
parent 228a7c6578
commit 830e3d549b
5 changed files with 11 additions and 7 deletions

View File

@ -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 = "";
}
};

View File

@ -54,7 +54,8 @@ function test() {
function setupCleanSlate() {
gLastOpenDirectory.reset();
gPrefService.clearUserPref(kPrefName);
if (gPrefService.prefHasUserValue(kPrefName))
gPrefService.clearUserPref(kPrefName);
}
setupCleanSlate();

View File

@ -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);
}
}

View File

@ -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);
}
}
};

View File

@ -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);
}