X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fwxwidgets%2Fdialogs%2Fplaylist.cpp;h=c15e050bca7c3a28c6fce32296f7a835dacf6a37;hb=105598d5b7e6b2ff69e5884b44d7d3ca3f6c919d;hp=f8b3603a8884a9c843486f2dac64df2d76c2d641;hpb=e496c16baa296c006f9dd2cb87fb7383085bcff1;p=vlc diff --git a/modules/gui/wxwidgets/dialogs/playlist.cpp b/modules/gui/wxwidgets/dialogs/playlist.cpp index f8b3603a88..c15e050bca 100644 --- a/modules/gui/wxwidgets/dialogs/playlist.cpp +++ b/modules/gui/wxwidgets/dialogs/playlist.cpp @@ -1038,7 +1038,7 @@ void Playlist::OnSearch( wxCommandEvent& WXUNUSED(event) ) p_wxroot = (PlaylistItem *)treectrl->GetItemData( treectrl->GetRootItem() ); playlist_item_t *p_root = playlist_ItemGetById( p_playlist, p_wxroot->i_id ); - if( !p_root ) abort(); + assert( p_root ); char *psz_name = wxFromLocale( search_string ); playlist_LiveSearchUpdate( p_playlist, p_root, psz_name ); Rebuild( VLC_TRUE ); @@ -1509,40 +1509,21 @@ void Playlist::OnPopup( wxContextMenuEvent& event ) void Playlist::OnPopupPlay( wxCommandEvent& event ) { playlist_item_t *p_popup_item, *p_popup_parent; - - - - abort(); - - LockPlaylist( p_intf->p_sys, p_playlist ); p_popup_item = playlist_ItemGetById( p_playlist, i_popup_item ); - p_popup_parent = playlist_ItemGetById( p_playlist, i_popup_parent ); - if( p_popup_item != NULL ) + + p_popup_parent = p_popup_item; + while( p_popup_parent ) { - if( p_popup_item->i_children > -1 ) - { - if( event.GetId() == PopupPlay_Event && - p_popup_item->i_children > 0 ) - { - playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, - 1242, p_popup_item, - p_popup_item->pp_children[0] ); - } - else - { - playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 1242, - p_popup_item, NULL ); - } - } - else - { - if( event.GetId() == PopupPlay_Event ) - { - playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, - 1242, p_popup_parent, p_popup_item ); - } - } + if( p_popup_parent == p_current_treeroot ) + break; + p_popup_parent = p_popup_parent->p_parent; + } + + if( p_popup_parent ) + { + playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, 1242, + p_popup_parent, p_popup_item ); } UnlockPlaylist( p_intf->p_sys, p_playlist ); }