mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1103361 - Start/stop sync tracker when engine is enabled/disabled by flipping the pref. r=rnewman
CLOSED TREE --HG-- extra : amend_source : 22355c1d80609addb52bb884a1927a48613255d4
This commit is contained in:
parent
84fc435498
commit
7b68377c42
@ -54,6 +54,8 @@ this.Tracker = function Tracker(name, engine) {
|
||||
|
||||
Svc.Obs.add("weave:engine:start-tracking", this);
|
||||
Svc.Obs.add("weave:engine:stop-tracking", this);
|
||||
|
||||
Svc.Prefs.observe("engine." + this.engine.prefName, this);
|
||||
};
|
||||
|
||||
Tracker.prototype = {
|
||||
@ -224,6 +226,11 @@ Tracker.prototype = {
|
||||
this._isTracking = false;
|
||||
}
|
||||
return;
|
||||
case "nsPref:changed":
|
||||
if (data == PREFS_BRANCH + "engine." + this.engine.prefName) {
|
||||
this.onEngineEnabledChanged(this.engine.enabled);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -628,7 +635,6 @@ Engine.prototype = {
|
||||
|
||||
set enabled(val) {
|
||||
Svc.Prefs.set("engine." + this.prefName, !!val);
|
||||
this._tracker.onEngineEnabledChanged(val);
|
||||
},
|
||||
|
||||
get score() this._tracker.score,
|
||||
|
@ -209,7 +209,7 @@ add_test(function test_disabled_no_track() {
|
||||
|
||||
tracker.addChangedID("abcdefghijkl");
|
||||
do_check_true(0 < tracker.changedIDs["abcdefghijkl"]);
|
||||
engine.enabled = false;
|
||||
Svc.Prefs.set("engine." + engine.prefName, false);
|
||||
do_check_false(tracker._isTracking);
|
||||
do_check_empty(tracker.changedIDs);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user