Currently doesn't yet reset view to default playlist. Atleast worked for me
if( item->i_id == i_cached_id ) i_cached_id = -1;
i_cached_input_id = -1;
- if( currentItem == item )
+ if( currentItem == item || rootItem == item)
{
currentItem = NULL;
emit currentChanged( QModelIndex() );
}
+ if(item == rootItem)
+ rootItem = NULL;
+
if( item->parentItem ) {
int i = item->parentItem->children.indexOf( item );
beginRemoveRows( index( item->parentItem, 0), i, i );
}
else delete item;
- if(item == rootItem)
- {
- rootItem = NULL;
- reset();
- }
}
/* This function must be entered WITH the playlist lock */