Commit fb5480e4 authored by Erwan Tulou's avatar Erwan Tulou

skins2: playlist (process delete everywhere in the same way)

Deleting an item can either be initiated by the user or coming from the core.
In one case, a m_deleted flag was added and notify occured before
deletion to avoid invalidated iterators.
This patch ensures that the other case is processed likewise.
parent 54919d68
......@@ -183,19 +183,23 @@ void Playtree::onUpdateCurrent( bool b_active )
// already removed it
void Playtree::onDelete( int i_id )
{
tree_update descr;
descr.i_id = i_id;
descr.i_type = 3;
Iterator item = findById( i_id ) ;
if( item != end() )
{
VarTree* parent = item->parent();
if( parent )
parent->removeChild( item );
item->m_deleted = true;
tree_update descr;
descr.i_id = i_id;
descr.i_type = 3;
descr.b_visible = parent ? parent->m_expanded : true;
notify( &descr );
if( parent )
parent->removeChild( item );
}
}
void Playtree::onAppend( playlist_add_t *p_add )
......
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