diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-12-23 19:33:42 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-12-23 19:33:42 +0000 |
commit | 93c4b258085b77b569755fcaa238f4cfdd23176e (patch) | |
tree | 7b68a49d495abb4778e0b38ed78d4229111c5df5 /src | |
parent | b10ee23e9b0720af7d24a1f7c77f7b5809c5fb5e (diff) | |
download | ayatana-indicator-sound-93c4b258085b77b569755fcaa238f4cfdd23176e.tar.gz ayatana-indicator-sound-93c4b258085b77b569755fcaa238f4cfdd23176e.tar.bz2 ayatana-indicator-sound-93c4b258085b77b569755fcaa238f4cfdd23176e.zip |
caught a bug to do with writing to gsettings
Diffstat (limited to 'src')
-rw-r--r-- | src/settings-manager.vala | 19 | ||||
-rw-r--r-- | src/sound-service.c | 4 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/settings-manager.vala b/src/settings-manager.vala index 05db430..f7bb3b6 100644 --- a/src/settings-manager.vala +++ b/src/settings-manager.vala @@ -27,7 +27,7 @@ public class SettingsManager : GLib.Object } construct{ this.settings = new Settings ("com.canonical.indicators.sound"); - settings.changed["blacklisted-media-players"].connect (on_blacklist_event); + this.settings.changed["blacklisted-media-players"].connect (on_blacklist_event); } public string[] fetch_blacklist() @@ -40,12 +40,21 @@ public class SettingsManager : GLib.Object return this.settings.get_strv ("interested-media-players"); } - public bool add_interested(string app_desktop_name) + public void clear_list() { - string[] already_interested = fetch_interested(); + this.settings.reset("interested-media-players"); + } + + public void add_interested(string app_desktop_name) + { + var already_interested = fetch_interested(); + foreach ( var s in already_interested){ + if ( s == app_desktop_name ) return; + } already_interested += (app_desktop_name); - return this.settings.set_strv( "interested-media-players", - already_interested ); + this.settings.set_strv( "interested-media-players", + already_interested ); + this.settings.apply(); } private void on_blacklist_event() diff --git a/src/sound-service.c b/src/sound-service.c index defcb94..98f1881 100644 --- a/src/sound-service.c +++ b/src/sound-service.c @@ -40,8 +40,8 @@ service_shutdown (IndicatorService *service, gpointer user_data) { if (mainloop != NULL) { g_debug("Service shutdown !"); - //close_pulse_activites(); - //g_main_loop_quit(mainloop); + close_pulse_activites(); + g_main_loop_quit(mainloop); } return; } |