1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 00:09:47 +01:00

Work around nasty drag & drop issue.

This commit is contained in:
Christian Muehlhaeuser 2015-04-12 06:38:58 +02:00
parent 4e3b537f43
commit 175bc80002

View File

@ -885,8 +885,13 @@ SourceTreeView::dropEvent( QDropEvent* event )
return;
}*/
QTreeView::dropEvent( event );
if ( event->isAccepted() )
{
tDebug() << Q_FUNC_INFO << "Ignoring accepted event!";
}
// if it's a playlist drop, accept it anywhere in the sourcetree by manually parsing it.
if ( DropJob::isDropType( DropJob::Playlist, event->mimeData() ) )
else if ( DropJob::isDropType( DropJob::Playlist, event->mimeData() ) )
{
DropJob* dropThis = new DropJob;
dropThis->setDropTypes( DropJob::Playlist );
@ -895,12 +900,12 @@ SourceTreeView::dropEvent( QDropEvent* event )
// Don't add it to the playlist under drop, it's a new playlist now
event->acceptProposedAction();
return;
event->accept();
}
if ( model()->dropMimeData( event->mimeData(), event->proposedAction(), index.row(), 0, index.parent() ) )
else if ( model()->dropMimeData( event->mimeData(), event->proposedAction(), index.row(), 0, index.parent() ) )
{
event->acceptProposedAction();
event->accept();
}
m_dragging = false;