aboutsummaryrefslogtreecommitdiff
path: root/src/playlists-menu-item.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-03-11 16:33:04 +0000
committerConor Curran <conor.curran@canonical.com>2011-03-11 16:33:04 +0000
commit52559196c4423636645644308758cb9fb69ae873 (patch)
tree9480f53106ff03c2ca7388cee9e8167c9d14e1ce /src/playlists-menu-item.vala
parent8f1d08d05f891ce0678434b139194f98590d5ec0 (diff)
parent9484c6a93caa72c9c6f1f4205c6982bc58615c58 (diff)
downloadayatana-indicator-sound-52559196c4423636645644308758cb9fb69ae873.tar.gz
ayatana-indicator-sound-52559196c4423636645644308758cb9fb69ae873.tar.bz2
ayatana-indicator-sound-52559196c4423636645644308758cb9fb69ae873.zip
reverted to more clumsy way of parsing the icon name for playlists
Diffstat (limited to 'src/playlists-menu-item.vala')
-rw-r--r--src/playlists-menu-item.vala8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/playlists-menu-item.vala b/src/playlists-menu-item.vala
index b3fd7c6..98d18f4 100644
--- a/src/playlists-menu-item.vala
+++ b/src/playlists-menu-item.vala
@@ -48,9 +48,8 @@ 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);
+ menuitem.property_set (MENUITEM_PROP_ICON_NAME, (string)result);
}
menuitem.property_set (MENUITEM_PATH, (string)detail.path);
@@ -84,7 +83,10 @@ 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];
}
public void update_individual_playlist (PlaylistDetails new_detail)