diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2011-03-23 12:03:02 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2011-03-23 12:03:02 -0400 |
commit | f05dff9b5d6c5e921f3056c142068ea7f6f41486 (patch) | |
tree | 9be3a5ff03f17db4a06e56815ad68de4c588c1ec /src/playlists-menu-item.vala | |
parent | 7619eab48daaa739fb3418237c693b7b463182f0 (diff) | |
parent | fb3a829f4bca4f16c51cb5305b941928296c52a7 (diff) | |
download | ayatana-indicator-sound-f05dff9b5d6c5e921f3056c142068ea7f6f41486.tar.gz ayatana-indicator-sound-f05dff9b5d6c5e921f3056c142068ea7f6f41486.tar.bz2 ayatana-indicator-sound-f05dff9b5d6c5e921f3056c142068ea7f6f41486.zip |
Import upstream version 0.6.5
Diffstat (limited to 'src/playlists-menu-item.vala')
-rw-r--r-- | src/playlists-menu-item.vala | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/playlists-menu-item.vala b/src/playlists-menu-item.vala index 79ab506..58c3875 100644 --- a/src/playlists-menu-item.vala +++ b/src/playlists-menu-item.vala @@ -46,15 +46,13 @@ public class PlaylistsMenuitem : PlayerItem public new void update (PlaylistDetails[] playlists) { foreach ( PlaylistDetails detail in playlists ){ - - if (this.already_observed(detail)) continue; + // We don't want to list playlists which are for videos)' + if (this.already_observed(detail) || this.is_video_related(detail)) + continue; 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, (string)result); - } + menuitem.property_set (MENUITEM_PROP_ICON_NAME, "playlist-symbolic"); menuitem.property_set (MENUITEM_PATH, (string)detail.path); menuitem.property_set_bool (MENUITEM_PROP_VISIBLE, true); @@ -80,28 +78,16 @@ public class PlaylistsMenuitem : PlayerItem if (this.root_item.property_get (MENUITEM_PATH) == item.property_get (MENUITEM_PATH)){ this.root_item.property_set (MENUITEM_PROP_LABEL, _("Choose Playlist")); } - this.root_item.child_delete (item); + this.root_item.child_delete (item); } } } - private string? parse_icon_path (string path) - { - 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) { foreach ( Dbusmenu.Menuitem item in this.current_playlists.values ){ if (new_detail.path == item.property_get (MENUITEM_PATH)){ item.property_set (MENUITEM_PROP_LABEL, new_detail.name); - var result = this.parse_icon_path (new_detail.icon_path); - if (result != null) { - item.property_set (MENUITEM_PROP_ICON_NAME, result); - } } } // If its active make sure the name is updated on the root item. @@ -119,6 +105,13 @@ public class PlaylistsMenuitem : PlayerItem return false; } + private bool is_video_related (PlaylistDetails new_detail) + { + var location = (string)new_detail.path; + if (location.contains ("/VideoLibrarySource/")) return true; + return false; + } + public void active_playlist_update (PlaylistDetails detail) { var update = detail.name; |