From 9484c6a93caa72c9c6f1f4205c6982bc58615c58 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 11 Mar 2011 16:23:38 +0000 Subject: revert to old way of parsing playlist icon path, i suspect some vala gremlins were working against us ... --- src/playlists-menu-item.vala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/playlists-menu-item.vala b/src/playlists-menu-item.vala index b3fd7c6..46bda50 100644 --- a/src/playlists-menu-item.vala +++ b/src/playlists-menu-item.vala @@ -48,9 +48,9 @@ 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); + debug("ICON PATH = %s and name = %s", detail.icon_path, Path.get_basename(detail.icon_path).split(".")[0]); + menuitem.property_set (MENUITEM_PROP_ICON_NAME, (string)result); } menuitem.property_set (MENUITEM_PATH, (string)detail.path); @@ -84,7 +84,11 @@ public class PlaylistsMenuitem : PlayerItem private string? parse_icon_path (string path) { - return ( path == "" ? null : Path.get_basename(path).split(".")[0] ); + if (path == "")return null; + var icon_file = File.new_for_path (path); + if (icon_file.get_path() == null)return null; + return icon_file.get_basename().split(".")[0]; + //return ( path == "" ? null : Path.get_basename(path).split(".")[0] ); } public void update_individual_playlist (PlaylistDetails new_detail) -- cgit v1.2.3