aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/settings-manager.vala19
-rw-r--r--src/sound-service.c4
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;
}