Qt4 Playlist: Disable moving items into top level of Playlist/Library Selector Panel
[vlc.git] / modules / gui / qt4 / components / playlist / playlist_model.cpp
index 87de8a0..d2fc147 100644 (file)
@@ -118,8 +118,10 @@ Qt::ItemFlags PLModel::flags( const QModelIndex &index ) const
     Qt::ItemFlags defaultFlags = QAbstractItemModel::flags( index );
     if( index.isValid() )
         return Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | defaultFlags;
-    else
-        return Qt::ItemIsDropEnabled | defaultFlags;
+    else if ( rootItem->i_id != p_playlist->p_root_onelevel->i_id
+          && rootItem->i_id != p_playlist->p_root_category->i_id )
+              defaultFlags |= Qt::ItemIsDropEnabled;
+    return defaultFlags;
 }
 
 /* A list of model indexes are a playlist */