[vlc-devel] commit: Qt: kill a bug in playlist model (Jakob Leben )

git version control git at videolan.org
Tue Feb 2 07:18:32 CET 2010


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Tue Feb  2 07:17:54 2010 +0100| [e5ca8a9b83d3f3c705e1250d588834cd298de015] | committer: Jakob Leben 

Qt: kill a bug in playlist model

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

 .../gui/qt4/components/playlist/playlist_model.cpp |    8 ++++++--
 1 files 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 da0fccf..2c3b8d2 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -609,6 +609,7 @@ void PLModel::processItemAppend( int i_item, int i_parent )
     playlist_item_t *p_item = NULL;
     PLItem *newItem = NULL;
     input_thread_t *currentInputThread;
+    int pos;
 
     PLItem *nodeItem = findById( rootItem, i_parent );
     if( !nodeItem ) return;
@@ -620,6 +621,9 @@ void PLModel::processItemAppend( int i_item, int i_parent )
     p_item = playlist_ItemGetById( p_playlist, i_item );
     if( !p_item || p_item->i_flags & PLAYLIST_DBL_FLAG ) goto end;
 
+    for( pos = 0; pos < p_item->p_parent->i_children; pos++ )
+        if( p_item->p_parent->pp_children[pos] == p_item ) break;
+
     newItem = new PLItem( p_item, nodeItem );
     PL_UNLOCK;
 
@@ -628,8 +632,8 @@ void PLModel::processItemAppend( int i_item, int i_parent )
         newItem->p_input == input_GetItem( currentInputThread ) )
             currentItem = newItem;
 
-    beginInsertRows( index( nodeItem, 0 ), nodeItem->childCount(), nodeItem->childCount() );
-    nodeItem->appendChild( newItem );
+    beginInsertRows( index( nodeItem, 0 ), pos, pos );
+    nodeItem->insertChild( newItem, pos );
     endInsertRows();
 
     if( currentItem == newItem )




More information about the vlc-devel mailing list