aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-01-05 12:41:18 +0000
committerConor Curran <conor.curran@canonical.com>2011-01-05 12:41:18 +0000
commitd9c023fd1ba9e5630755634d7f0e983081cbc195 (patch)
treec5fb6e0f57bfb751a78d92d807b84275507bef17 /src
parent057a66af1bb84160e6bb1181274b3ca4cfc36983 (diff)
downloadayatana-indicator-sound-d9c023fd1ba9e5630755634d7f0e983081cbc195.tar.gz
ayatana-indicator-sound-d9c023fd1ba9e5630755634d7f0e983081cbc195.tar.bz2
ayatana-indicator-sound-d9c023fd1ba9e5630755634d7f0e983081cbc195.zip
blacklisting in place
Diffstat (limited to 'src')
-rw-r--r--src/settings-manager.vala13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/settings-manager.vala b/src/settings-manager.vala
index f7bb3b6..57b4487 100644
--- a/src/settings-manager.vala
+++ b/src/settings-manager.vala
@@ -35,9 +35,16 @@ public class SettingsManager : GLib.Object
return this.settings.get_strv ("blacklisted-media-players");
}
- public string[] fetch_interested()
+ public ArrayList<string> fetch_interested()
{
- return this.settings.get_strv ("interested-media-players");
+ var blacklisted = this.settings.get_strv ("blacklisted-media-players");
+ var interested = this.settings.get_strv ("interested-media-players");
+ var list = new ArrayList<string>();
+ foreach(var s in interested){
+ if ( s in blacklisted ) continue;
+ list.add(s);
+ }
+ return list;
}
public void clear_list()
@@ -47,7 +54,7 @@ public class SettingsManager : GLib.Object
public void add_interested(string app_desktop_name)
{
- var already_interested = fetch_interested();
+ var already_interested = this.settings.get_strv ("interested-media-players");
foreach ( var s in already_interested){
if ( s == app_desktop_name ) return;
}