]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/playlist_model.cpp
Use pl_Locked and pl_Unlocked.
[vlc] / modules / gui / qt4 / components / playlist / playlist_model.cpp
index 0191ae76a5599a130386b33fc379d07d69180ae8..710156accb017bc480237547565c27e8e482d05c 100644 (file)
@@ -276,7 +276,7 @@ void PLModel::activateItem( playlist_item_t *p_item )
         p_parent = p_parent->p_parent;
     }
     if( p_parent )
-        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, true,
+        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked,
                           p_parent, p_item );
 }
 
@@ -523,7 +523,11 @@ void PLModel::ProcessInputItemUpdate( int i_input_id )
     if( i_input_id <= 0 ) return;
     PLItem *item = FindByInput( rootItem, i_input_id );
     if( item )
+    {
+        QPL_LOCK;
         UpdateTreeItem( item, true );
+        QPL_UNLOCK;
+    }
 }
 
 void PLModel::ProcessItemRemoval( int i_id )
@@ -715,6 +719,16 @@ void PLModel::sort( int column, Qt::SortOrder order )
     int i_index = -1;
     int i_flag = 0;
 
+    // FIXME: Disable sorting on startup by ignoring
+    // first call of sorting caused by showing dialog
+    // see: standardpanel.cpp:65
+    static bool b_first_time = true;
+    if( b_first_time )
+    {
+        b_first_time = false;
+        return;
+    }
+
 #define CHECK_COLUMN( meta )                        \
 {                                                   \
     if( ( shownFlags() & meta ) )                   \
@@ -813,13 +827,14 @@ void PLModel::popup( QModelIndex & index, QPoint &point, QModelIndexList list )
 void PLModel::viewchanged( int meta )
 {
     assert( meta );
+    int _meta = meta;
     if( rootItem )
     {
         int index=-1;
-        while( meta )
+        while( _meta )
         {
             index++;
-            meta >>= 1;
+            _meta >>= 1;
         }
 
         /* UNUSED        emit layoutAboutToBeChanged(); */
@@ -865,7 +880,7 @@ void PLModel::popupInfo()
 {
     playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
                                                     i_popup_item,
-                                                    true );
+                                                    false );
     if( p_item )
     {
         MediaInfoDialog *mid = new MediaInfoDialog( p_intf, p_item->p_input );