vlc_linux/vlc-3.0.16/modules/gui/qt/components/playlist/playlist_model.cpp
/**
 * Deletion, don't delete items childrens if item is going to be
 * delete allready, so we remove childrens from selection-list.
 */
Deletion, don't delete items childrens if item is going to be
delete allready, so we remove childrens from selection-list.
Deletion don ' t delete items childrens if item is going to be delete allready so we remove childrens from selection - list .
void PLModel::doDelete( QModelIndexList selected )
{
    if( !canEdit() ) return;
    while( !selected.isEmpty() )
    {
        QModelIndex index = selected[0];
        selected.removeAt( 0 );
        if( index.column() != 0 ) continue;
        PLItem *item = getItem( index );
        if( item->childCount() )
            recurseDelete( item->children, &selected );
        PL_LOCK;
        playlist_item_t *p_root = playlist_ItemGetById( p_playlist,
                                                        item->id() );
        if( p_root != NULL )
            playlist_NodeDelete( p_playlist, p_root );
        PL_UNLOCK;
        if( p_root != NULL )
            removeItem( item );
    }
}
void PLModel :: doDelete ( QModelIndexList selected ) { if ( ! canEdit ( ) ) return ; while ( ! selected . isEmpty ( ) ) { QModelIndex index = selected [ 0 ] ; selected . removeAt ( 0 ) ; if ( index . column ( ) != 0 ) continue ; PLItem * item = getItem ( index ) ; if ( item -> childCount ( ) ) recurseDelete ( item -> children , & selected ) ; PL_LOCK ; playlist_item_t * p_root = playlist_ItemGetById ( p_playlist , item -> id ( ) ) ; if ( p_root != NULL ) playlist_NodeDelete ( p_playlist , p_root ) ; PL_UNLOCK ; if ( p_root != NULL ) removeItem ( item ) ; } }
Deletion, don't delete items childrens if item is going to be
 delete allready, so we remove childrens from selection-list.
Deletion don ' t delete items childrens if item is going to be delete allready so we remove childrens from selection - list .