Closed Bug 558890 Opened 14 years ago Closed 14 years ago

refactor pref sync to not sync pref type

Categories

(Firefox :: Sync, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 560580

People

(Reporter: mconnor, Unassigned)

Details

Our current impl is syncing extra data, and has unnecessarily-complex code.  From bug 548385:

* we could use Preferences.js to simplify a lot of this if we stop syncing
type!

  _prefs:     new Preferences();

  _getAllPrefs: function () {
    let values = {};
    let toSync = this._syncPrefs;

    for (let i = 0; i < toSync.length; i++) {
      if (!this._prefs.get(WEAVE_SYNC_PREFS + toSync[i]), false)
        continue;

      let val = this._prefs.get(toSync[i], "");
      if (val)
        values[toSync[i]] = val;
    }

    return values;
  },

  _setAllPrefs: function(values) {
    for (let pref in values) {
      if (!this._prefs.get(WEAVE_SYNC_PREFS + toSync[i]), false)
        continue;
      try {
        this._prefs.set(pref, values[pref]);
      catch(e) {
        this._log.trace("Failed to set pref: " + pref + " Reason: " + e);
      } 
    }   
  }
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.