diff options
author | Conor Curran <conor.curran@canonical.com> | 2012-02-27 19:08:57 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2012-02-27 19:08:57 +0000 |
commit | b55fd2bd64c8075c86a38054900f3c59dbf53957 (patch) | |
tree | 3b964d629deaa5727ca42fbb4d42753abd40be4c /src/settings-manager.vala | |
parent | 062aadf6d9ab7f1cecfab74159507047d52dc6d8 (diff) | |
download | ayatana-indicator-sound-b55fd2bd64c8075c86a38054900f3c59dbf53957.tar.gz ayatana-indicator-sound-b55fd2bd64c8075c86a38054900f3c59dbf53957.tar.bz2 ayatana-indicator-sound-b55fd2bd64c8075c86a38054900f3c59dbf53957.zip |
make sure we are dynamically sensitive to players being uninstalled whilst they still have an entry in the menu
Diffstat (limited to 'src/settings-manager.vala')
-rw-r--r-- | src/settings-manager.vala | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/settings-manager.vala b/src/settings-manager.vala index a2be080..034cd03 100644 --- a/src/settings-manager.vala +++ b/src/settings-manager.vala @@ -46,7 +46,7 @@ public class SettingsManager : GLib.Object } if (s in list) continue; if (s in blacklisted) continue; - list.add(s); + list.add(s); } return list; } @@ -56,6 +56,20 @@ public class SettingsManager : GLib.Object this.settings.reset("interested-media-players"); } + public void remove_interested (string app_desktop_name) + { + var already_interested = this.settings.get_strv ("interested-media-players"); + var list = new ArrayList<string>(); + + foreach (var s in already_interested){ + if (s == app_desktop_name) continue; + list.add (s); + } + this.settings.set_strv("interested-media-players", + list.to_array()); + this.settings.apply(); + } + public void add_interested (string app_desktop_name) { var already_interested = this.settings.get_strv ("interested-media-players"); |