From 9406f55ac2b033265c677af7a84dd77cc5cdd72c Mon Sep 17 00:00:00 2001 From: Edward Lee Date: Tue, 23 Mar 2010 18:51:47 -0700 Subject: [PATCH] Bug 554472 - Only sync prefs under extensions.weave.prefs.sync. (with a trailing dot) [r=mconnor] Add a "." to the end of WEAVE_SYNC_PREFS value and fix up uses that did extra work to remove the dot (or something that might not have been a dot). --- services/sync/modules/engines/prefs.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/services/sync/modules/engines/prefs.js b/services/sync/modules/engines/prefs.js index 1d95c143ab71..a50c7f9ee05e 100644 --- a/services/sync/modules/engines/prefs.js +++ b/services/sync/modules/engines/prefs.js @@ -40,7 +40,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cu = Components.utils; -const WEAVE_SYNC_PREFS = "extensions.weave.prefs.sync"; +const WEAVE_SYNC_PREFS = "extensions.weave.prefs.sync."; const WEAVE_PREFS_GUID = "preferences"; Cu.import("resource://weave/util.js"); @@ -91,8 +91,7 @@ PrefStore.prototype = { get _syncPrefs() { let service = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefService); - let syncPrefs = service.getBranch(WEAVE_SYNC_PREFS).getChildList("", {}). - map(function(elem) { return elem.substr(1); }); + let syncPrefs = service.getBranch(WEAVE_SYNC_PREFS).getChildList("", {}); this.__defineGetter__("_syncPrefs", function() syncPrefs); return syncPrefs; @@ -104,7 +103,7 @@ PrefStore.prototype = { let pref; for (let i = 0; i < toSync.length; i++) { - if (!this._prefs.getBoolPref(WEAVE_SYNC_PREFS + "." + toSync[i])) + if (!this._prefs.getBoolPref(WEAVE_SYNC_PREFS + toSync[i])) continue; pref = {}; @@ -230,8 +229,7 @@ PrefTracker.prototype = { get _syncPrefs() { let service = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefService); - let syncPrefs = service.getBranch(WEAVE_SYNC_PREFS).getChildList("", {}). - map(function(elem) { return elem.substr(1); }); + let syncPrefs = service.getBranch(WEAVE_SYNC_PREFS).getChildList("", {}); this.__defineGetter__("_syncPrefs", function() syncPrefs); return syncPrefs;