Commit 0601ce74 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

control/flat_media_list_view.c: Send WillAdd/Added WillDelete/Deleted events.

parent b269d0ed
......@@ -49,9 +49,12 @@ struct libvlc_media_list_view_private_t
static void
ml_item_added( const libvlc_event_t * p_event, libvlc_media_list_view_t * p_mlv )
{
int index = vlc_array_count( &p_mlv->p_this_view_data->array );
libvlc_media_descriptor_t * p_md = p_event->u.media_list_item_added.item;
libvlc_media_descriptor_retain( p_md );
libvlc_media_list_view_will_add_item( p_mlv, p_md, index );
vlc_array_append( &p_mlv->p_this_view_data->array, p_md );
libvlc_media_list_view_item_added( p_mlv, p_md, index );
}
/**************************************************************************
......@@ -64,7 +67,9 @@ ml_item_removed( const libvlc_event_t * p_event, libvlc_media_list_view_t * p_ml
int i = vlc_array_index_of_item( &p_mlv->p_this_view_data->array, p_md );
if( i >= 0 )
{
libvlc_media_list_view_will_delete_item( p_mlv, p_md, i );
vlc_array_remove( &p_mlv->p_this_view_data->array, i );
libvlc_media_list_view_item_deleted( p_mlv, p_md, i );
libvlc_media_descriptor_release( p_md );
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment