From bd007a90262f90081c1be04947e949191cb7e1c6 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 11 Mar 2011 11:43:09 +0000 Subject: players who do not export icon names will have iconless playlists menuitems --- src/playlists-menu-item.vala | 13 +++++-------- src/sound-service.c | 6 ++---- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src') 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]; } diff --git a/src/sound-service.c b/src/sound-service.c index 553f07a..cfc0b7e 100644 --- a/src/sound-service.c +++ b/src/sound-service.c @@ -39,10 +39,8 @@ service_shutdown (IndicatorService *service, gpointer user_data) { if (mainloop != NULL) { g_debug("Service shutdown !"); - - //close_pulse_activites(); - //g_main_loop_quit(mainloop); - + close_pulse_activites(); + g_main_loop_quit(mainloop); } return; } -- cgit v1.2.3