From c80a170ae02ae60f861745d6073aeb4aaf0efa57 Mon Sep 17 00:00:00 2001 From: Ilkka Ollakka Date: Sun, 20 Jun 2010 13:32:45 +0300 Subject: [PATCH] Revert "Qt4: don't do playlist_model recursive remove as core signals for those anyway" This reverts commit 926bbf142f297f9715e3cc5ad746b98a448c3451. --- modules/gui/qt4/components/playlist/playlist_model.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp index c86a701086..d1a7ac4187 100644 --- a/modules/gui/qt4/components/playlist/playlist_model.cpp +++ b/modules/gui/qt4/components/playlist/playlist_model.cpp @@ -779,8 +779,10 @@ void PLModel::updateTreeItem( PLItem *item ) /************************* Actions ******************************/ /** - * Lets not worry about nodes children, we do refersh anyway when - * core tells that playlist has changed, should give some more speed + * Deletion, here we have to do a ugly slow hack as we retrieve the full + * list of indexes to delete at once: when we delete a node and all of + * its children, we need to update the list. + * Todo: investigate whethere we can use ranges to be sure to delete all items? */ void PLModel::doDelete( QModelIndexList selected ) { @@ -794,6 +796,8 @@ void PLModel::doDelete( QModelIndexList selected ) if( index.column() != 0 ) continue; PLItem *item = getItem( index ); + if( item->children.size() ) + recurseDelete( item->children, &selected ); PL_LOCK; playlist_DeleteFromInput( p_playlist, item->p_input, pl_Locked ); -- 2.39.2