]> git.sesse.net Git - vlc/commitdiff
Qt4 - fix QT playlist display bug when clicking on top-level of playlist.
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 6 Aug 2007 17:03:01 +0000 (17:03 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 6 Aug 2007 17:03:01 +0000 (17:03 +0000)
Patch by Alexander Gall. Thanks.

modules/gui/qt4/playlist_model.cpp

index af819c83f6739b1b0b66cb78d007a187dc81536f..0d7c2fea2a6a5fa770cb50b19b03aa9d970acffd 100644 (file)
@@ -745,11 +745,14 @@ void PLModel::rebuild( playlist_item_t *p_root )
     /* Clear the tree */
     if( rootItem )
     {
-        beginRemoveRows( index( rootItem, 0 ), 0,
-                         rootItem->children.size() -1 );
-        qDeleteAll( rootItem->children );
-        rootItem->children.clear();
-        endRemoveRows();
+        if( rootItem->children.size() )
+        {
+            beginRemoveRows( index( rootItem, 0 ), 0,
+                    rootItem->children.size() -1 );
+            qDeleteAll( rootItem->children );
+            rootItem->children.clear();
+            endRemoveRows();
+        }
     }
     if( p_root )
     {