mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Fix dropping ou the sourcetree, qtreeview is really crappy in this case
This commit is contained in:
@@ -194,13 +194,17 @@ bool
|
|||||||
SourcesModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent )
|
SourcesModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent )
|
||||||
{
|
{
|
||||||
SourceTreeItem* item;
|
SourceTreeItem* item;
|
||||||
|
qDebug() << "Got mime data dropped:" << row << column << parent << itemFromIndex( parent )->text();
|
||||||
if( row == -1 && column == -1 )
|
if( row == -1 && column == -1 )
|
||||||
item = itemFromIndex( parent );
|
item = itemFromIndex( parent );
|
||||||
else
|
else if( column == 0 )
|
||||||
item = itemFromIndex( index( row, column, parent ) );
|
item = itemFromIndex( index( row, column, parent ) );
|
||||||
|
else // column is -1, that means the drop is happening "below" the indices. that means we actually want the one before it
|
||||||
|
item = itemFromIndex( index( row - 1, 0, parent ) );
|
||||||
|
|
||||||
Q_ASSERT( item );
|
Q_ASSERT( item );
|
||||||
|
|
||||||
|
qDebug() << "Dropping on:" << item->text();
|
||||||
return item->dropMimeData( data, action );
|
return item->dropMimeData( data, action );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user