Bug 534687 - Weave's pref syncing can sync lightweight themes in a broken fashion

Trigger lightweight theme manager's currentTheme setter when changing the usedThemes pref.
This commit is contained in:
Edward Lee 2009-12-14 16:05:07 -08:00
parent 4bdfeb9b77
commit baf9c41432

View File

@ -147,6 +147,22 @@ PrefStore.prototype = {
break;
case "string":
this._prefs.setCharPref(values[i]["name"], values[i]["value"]);
// Notify the lightweight theme manager of the new value
if (values[i].name == "lightweightThemes.usedThemes") {
try {
let ltm = {};
Cu.import("resource://gre/modules/LightweightThemeManager.jsm", ltm);
ltm = ltm.LightweightThemeManager;
if (ltm.currentTheme) {
ltm.currentTheme = null;
ltm.currentTheme = ltm.usedThemes[0];
}
}
// LightweightThemeManager only exists in Firefox 3.6+
catch (ex) {}
}
break;
case "boolean":
this._prefs.setBoolPref(values[i]["name"], values[i]["value"]);