aboutsummaryrefslogtreecommitdiff
path: root/src/familiar-players-db.vala
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2010-11-12 10:14:48 -0500
committerKen VanDine <ken.vandine@canonical.com>2010-11-12 10:14:48 -0500
commit908222c0681fba3c6e1265d0f85a0b667927c169 (patch)
tree9ba8897f7bcc24b669fe7f38f6ca25e6260aa374 /src/familiar-players-db.vala
parentbf3a1c75ef1714077d6729cdc4d550020365a3a3 (diff)
parent5fd2c5e12a059ab8c59306676d18dfc56c818077 (diff)
downloadayatana-indicator-sound-908222c0681fba3c6e1265d0f85a0b667927c169.tar.gz
ayatana-indicator-sound-908222c0681fba3c6e1265d0f85a0b667927c169.tar.bz2
ayatana-indicator-sound-908222c0681fba3c6e1265d0f85a0b667927c169.zip
Import upstream version 0.5.1
Diffstat (limited to 'src/familiar-players-db.vala')
-rw-r--r--src/familiar-players-db.vala24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/familiar-players-db.vala b/src/familiar-players-db.vala
index 28ac286..af7d07f 100644
--- a/src/familiar-players-db.vala
+++ b/src/familiar-players-db.vala
@@ -29,7 +29,7 @@ public class FamiliarPlayersDB : GLib.Object
{
private const string GROUP_NAME = "Seen Database";
private const string KEY_NAME = "DesktopFiles";
- private const string DEFAULT_APP_DESKTOP = "/usr/share/applications/rhythmbox.desktop";
+ private const string DEFAULT_APP_DESKTOP = "/usr/share/applications/banshee-1.desktop";
private HashMap<string, bool> players_DB;
private string file_name;
private string dir_name;
@@ -159,5 +159,25 @@ public class FamiliarPlayersDB : GLib.Object
{
return this.players_DB.keys;
}
-
+
+ public static string? fetch_icon_name(string desktop_path)
+ {
+ KeyFile desktop_keyfile = new KeyFile ();
+ try{
+ desktop_keyfile.load_from_file (desktop_path, KeyFileFlags.NONE);
+ }
+ catch(GLib.FileError error){
+ warning("Error loading keyfile");
+ return null;
+ }
+ try{
+ return desktop_keyfile.get_string (KeyFileDesktop.GROUP,
+ KeyFileDesktop.KEY_ICON);
+ }
+ catch(GLib.KeyFileError error){
+ warning("Error trying to fetch the icon name from the keyfile");
+ return null;
+ }
+ }
+
} \ No newline at end of file