]> git.sesse.net Git - vlc/commitdiff
qt4: playlist_model, set current to NULL if currentitem is removed or input changed...
authorIlkka Ollakka <ileoo@videolan.org>
Sun, 16 Aug 2009 11:43:32 +0000 (14:43 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Sun, 16 Aug 2009 11:45:26 +0000 (14:45 +0300)
modules/gui/qt4/components/playlist/playlist_model.cpp

index 527d6dd4a3be6ef9cc2e8d1e39662aaddc8b188d..82b91c2f104f1d97986302c5f7ec0b10d9e76947 100644 (file)
@@ -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 )
 {