[vlc-devel] commit: qt4: don' t crash when sd is selected in playlist and unloaded from menu ( Ilkka Ollakka )

git version control git at videolan.org
Thu Oct 29 18:23:14 CET 2009


vlc | branch: master | Ilkka Ollakka <ileoo at iki.fi> | Thu Oct 29 19:15:53 2009 +0200| [00ee289f2d69c279911608be7bb5d4f274921d56] | committer: Ilkka Ollakka 

qt4: don't crash when sd is selected in playlist and unloaded from menu

Currently doesn't yet reset view to default playlist. Atleast worked for me

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

 .../gui/qt4/components/playlist/playlist_model.cpp |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 62cbcc5..198cb85 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -760,12 +760,15 @@ void PLModel::removeItem( PLItem *item )
     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 );
@@ -775,11 +778,6 @@ void PLModel::removeItem( PLItem *item )
     }
     else delete item;
 
-    if(item == rootItem)
-    {
-        rootItem = NULL;
-        reset();
-    }
 }
 
 /* This function must be entered WITH the playlist lock */




More information about the vlc-devel mailing list