Skip to content

Commit

Permalink
fix: remove deprecated plugins from GSettings
Browse files Browse the repository at this point in the history
Establish a simple method for removing deprecated plugins from
GSettings during device constructon.

closes #1686
  • Loading branch information
andyholmes authored and daniellandau committed Oct 4, 2023
1 parent b8243a8 commit a2c7d41
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/service/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ var Device = GObject.registerClass({
),
path: `/org/gnome/shell/extensions/gsconnect/device/${this.id}/`,
});
this._migratePlugins();

// Watch for changes to supported and disabled plugins
this._disabledPluginsChangedId = this.settings.connect(
Expand Down Expand Up @@ -252,6 +253,15 @@ var Device = GObject.registerClass({
return this.settings.get_string('type');
}

_migratePlugins() {
const deprecated = ['photo'];
const supported = this.settings
.get_strv('supported-plugins')
.filter(name => !deprecated.includes(name));

this.settings.set_strv('supported-plugins', supported);
}

_handleIdentity(packet) {
this.freeze_notify();

Expand Down

0 comments on commit a2c7d41

Please sign in to comment.