aboutsummaryrefslogtreecommitdiff
path: root/src/settings-manager.vala
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2012-03-30 14:12:41 -0400
committerKen VanDine <ken.vandine@canonical.com>2012-03-30 14:12:41 -0400
commit66d95fc3a6a73357578051739dd58b5622ceffd6 (patch)
treeb5bcad02ebe6ad24428dfb9544e3bcf08871b44e /src/settings-manager.vala
parentd738d091793595d86f1a2353b06bf3584b0afbf9 (diff)
parent31b5a5a6508535ed1af86919c79d75571f1a65ef (diff)
downloadayatana-indicator-sound-66d95fc3a6a73357578051739dd58b5622ceffd6.tar.gz
ayatana-indicator-sound-66d95fc3a6a73357578051739dd58b5622ceffd6.tar.bz2
ayatana-indicator-sound-66d95fc3a6a73357578051739dd58b5622ceffd6.zip
* New upstream release.
- Inconsistency between messaging menu and sound menu pips (LP: #933593) - indicator-sound-service crashed with SIGSEGV in fast_validate() (LP: #949837) - free-memory-read crash in indicator-sound-service's file monitoring (LP: #965848) - minor memory leaks in blacklist handling (LP: #960578) - FIX (LP: FIX)
Diffstat (limited to 'src/settings-manager.vala')
-rw-r--r--src/settings-manager.vala32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/settings-manager.vala b/src/settings-manager.vala
index 034cd03..d57241e 100644
--- a/src/settings-manager.vala
+++ b/src/settings-manager.vala
@@ -58,27 +58,31 @@ public class SettingsManager : GLib.Object
public void remove_interested (string app_desktop_name)
{
- var already_interested = this.settings.get_strv ("interested-media-players");
- var list = new ArrayList<string>();
+ const string key = "interested-media-players";
+ var players = new GLib.VariantBuilder (new VariantType ("as")); // array of strings
- foreach (var s in already_interested){
- if (s == app_desktop_name) continue;
- list.add (s);
+ foreach (var player in this.settings.get_strv (key)) {
+ if (player != app_desktop_name)
+ players.add ("s", player);
}
- this.settings.set_strv("interested-media-players",
- list.to_array());
- this.settings.apply();
+
+ this.settings.set_value(key, players.end());
+ this.settings.apply();
}
public void add_interested (string app_desktop_name)
{
- var already_interested = this.settings.get_strv ("interested-media-players");
- foreach (var s in already_interested){
- if ( s == app_desktop_name ) return;
+ const string key = "interested-media-players";
+ var players = new GLib.VariantBuilder (new VariantType ("as")); // array of strings
+
+ foreach (var player in this.settings.get_strv (key)) {
+ if (player == app_desktop_name)
+ return;
+ players.add ("s", player);
}
- already_interested += (app_desktop_name);
- this.settings.set_strv( "interested-media-players",
- already_interested );
+
+ players.add ("s", app_desktop_name);
+ this.settings.set_value(key, players.end());
this.settings.apply();
}