From fa52f8a75c42a831df52d2c81f4a5a1db699d743 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 26 Jun 2012 03:33:35 +0200 Subject: [PATCH] * Don't expand LovedTracksItem. --- src/sourcetree/SourceTreeView.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/sourcetree/SourceTreeView.cpp b/src/sourcetree/SourceTreeView.cpp index 64e94b357..ce9911c08 100644 --- a/src/sourcetree/SourceTreeView.cpp +++ b/src/sourcetree/SourceTreeView.cpp @@ -649,7 +649,7 @@ SourceTreeView::dragMoveEvent( QDragMoveEvent* event ) setDirtyRegion( m_dropRect ); const QPoint pos = event->pos(); const QModelIndex index = indexAt( pos ); - dataChanged(m_dropIndex, m_dropIndex); + dataChanged( m_dropIndex, m_dropIndex ); m_dropIndex = QPersistentModelIndex( index ); if ( index.isValid() ) @@ -658,12 +658,23 @@ SourceTreeView::dragMoveEvent( QDragMoveEvent* event ) m_dropRect = rect; SourceTreeItem* item = itemFromIndex< SourceTreeItem >( index ); + if ( item->willAcceptDrag( event->mimeData() ) ) { - accept = true; - m_delegate->hovered( index, event->mimeData() ); - dataChanged(index, index); + + switch ( model()->data( index, SourcesModel::SourceTreeItemTypeRole ).toInt() ) + { + case SourcesModel::StaticPlaylist: + case SourcesModel::CategoryAdd: + m_delegate->hovered( index, event->mimeData() ); + dataChanged( index, index ); + break; + + default: + break; + } + } else m_delegate->hovered( QModelIndex(), 0 );