[vlc-devel] commit: qt4: playlist_model, set current to NULL if currentitem is removed or input changed to NULL ( Ilkka Ollakka )

git version control git at videolan.org
Sun Aug 16 13:50:55 CEST 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Aug 16 14:43:32 2009 +0300| [1e4bb1e0d437a50344ae8474b4a753aa10ed738d] | committer: Ilkka Ollakka 

qt4: playlist_model, set current to NULL if currentitem is removed or input changed to NULL

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e4bb1e0d437a50344ae8474b4a753aa10ed738d
---

 .../gui/qt4/components/playlist/playlist_model.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 527d6dd..82b91c2 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -282,6 +282,7 @@ bool PLModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
 void PLModel::removeItem( int i_id )
 {
     PLItem *item = FindById( rootItem, i_id );
+    if( currentItem && currentItem->p_input == item->p_input ) currentItem = NULL;
     if( item ) item->remove( item );
 }
 
@@ -663,6 +664,10 @@ void PLModel::ProcessInputItemUpdate( input_thread_t *p_input )
         currentItem = item;
         emit currentChanged( index( item, 0 ) );
     }
+    else
+    {
+        currentItem = NULL;
+    }
 }
 void PLModel::ProcessInputItemUpdate( input_item_t *p_item )
 {




More information about the vlc-devel mailing list