aboutsummaryrefslogtreecommitdiff
path: root/src/playlists-menu-item.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-03-11 11:43:09 +0000
committerConor Curran <conor.curran@canonical.com>2011-03-11 11:43:09 +0000
commitbd007a90262f90081c1be04947e949191cb7e1c6 (patch)
tree0a566f352f49fb4d31b9a1ed448221eec35d19ca /src/playlists-menu-item.vala
parent8ded632700c7331b9e4e1f9f1b19ae9bade2eced (diff)
downloadayatana-indicator-sound-bd007a90262f90081c1be04947e949191cb7e1c6.tar.gz
ayatana-indicator-sound-bd007a90262f90081c1be04947e949191cb7e1c6.tar.bz2
ayatana-indicator-sound-bd007a90262f90081c1be04947e949191cb7e1c6.zip
players who do not export icon names will have iconless playlists menuitems
Diffstat (limited to 'src/playlists-menu-item.vala')
-rw-r--r--src/playlists-menu-item.vala13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/playlists-menu-item.vala b/src/playlists-menu-item.vala
index 2b820e5..9dcb686 100644
--- a/src/playlists-menu-item.vala
+++ b/src/playlists-menu-item.vala
@@ -48,12 +48,11 @@ public class PlaylistsMenuitem : PlayerItem
Dbusmenu.Menuitem menuitem = new Menuitem();
menuitem.property_set (MENUITEM_PROP_LABEL, detail.name);
var result = this.parse_icon_path (detail.icon_path);
+
if (result != null) {
- menuitem.property_set (MENUITEM_PROP_ICON_NAME, result);
- }
- // TODO: Make sure to set a stock playlist image
- else{
+ menuitem.property_set (MENUITEM_PROP_ICON_NAME, result);
}
+
menuitem.property_set (MENUITEM_PATH, (string)detail.path);
menuitem.property_set_bool (MENUITEM_PROP_VISIBLE, true);
menuitem.property_set_bool (MENUITEM_PROP_ENABLED, true);
@@ -85,11 +84,9 @@ public class PlaylistsMenuitem : PlayerItem
private string? parse_icon_path (string path)
{
+ if (path == "")return null;
var icon_file = File.new_for_path (path);
-
- if (icon_file.get_basename() == null)return null;
-
- debug ("icon name = %s", icon_file.get_basename().split(".")[0]);
+ if (icon_file.get_path() == null)return null;
return icon_file.get_basename().split(".")[0];
}