]> git.sesse.net Git - vlc/commitdiff
qt4: little tweaking on PLModel::flags on playlist-locking
authorIlkka Ollakka <ileoo@videolan.org>
Tue, 18 Aug 2009 10:30:10 +0000 (13:30 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 18 Aug 2009 13:15:34 +0000 (16:15 +0300)
modules/gui/qt4/components/playlist/playlist_model.cpp

index 577fae6c0c24eaef49cbdcac7ae095efd1313f27..442e753e4d01a658426e3454262d536eea8d3e47 100644 (file)
@@ -156,16 +156,18 @@ Qt::ItemFlags PLModel::flags( const QModelIndex &index ) const
             || item->p_input == ml_input)
                 flags |= Qt::ItemIsDropEnabled;
     }
-    else
+    else if( rootItem->p_input == pl_input ||
+            rootItem->p_input == ml_input )
     {
         PL_LOCK;
         playlist_item_t *plItem =
             playlist_ItemGetById( p_playlist, item->i_id );
-        if ( plItem && ( plItem->i_children > -1 ) &&
-            ( rootItem->p_input == pl_input ||
-            rootItem->p_input == ml_input ) )
-                flags |= Qt::ItemIsDropEnabled;
+
+        if ( plItem && ( plItem->i_children > -1 ) )
+            flags |= Qt::ItemIsDropEnabled;
+
         PL_UNLOCK;
+
         flags |= Qt::ItemIsDragEnabled;
     }