Qt4 Playlist: Disable moving items into top level of Playlist/Library Selector Panel
authorJakob Leben <jakob.leben@gmail.com>
Sun, 2 Aug 2009 05:30:57 +0000 (07:30 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 8 Aug 2009 17:16:44 +0000 (20:16 +0300)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
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 */