aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/playlists-menu-item.vala13
-rw-r--r--src/sound-service.c6
2 files changed, 7 insertions, 12 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];
}
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;
}