mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Don't accept all drops on playlist items, only what DropJob says we want
This commit is contained in:
@@ -138,7 +138,7 @@ bool
|
|||||||
PlaylistItem::willAcceptDrag( const QMimeData* data ) const
|
PlaylistItem::willAcceptDrag( const QMimeData* data ) const
|
||||||
{
|
{
|
||||||
Q_UNUSED( data );
|
Q_UNUSED( data );
|
||||||
return !m_playlist.isNull() && m_playlist->author()->isLocal();
|
return !m_playlist.isNull() && m_playlist->author()->isLocal() && DropJob::acceptsMimeData( data, DropJob::Track );
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaylistItem::DropTypes
|
PlaylistItem::DropTypes
|
||||||
@@ -175,7 +175,12 @@ PlaylistItem::dropMimeData( const QMimeData* data, Qt::DropAction action )
|
|||||||
data->data( "application/tomahawk.playlist.id" ) == m_playlist->guid() )
|
data->data( "application/tomahawk.playlist.id" ) == m_playlist->guid() )
|
||||||
return false; // don't allow dropping on ourselves
|
return false; // don't allow dropping on ourselves
|
||||||
|
|
||||||
|
if ( !DropJob::acceptsMimeData( data, DropJob::Track ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
DropJob *dj = new DropJob();
|
DropJob *dj = new DropJob();
|
||||||
|
dj->setDropTypes( DropJob::Track );
|
||||||
|
|
||||||
connect( dj, SIGNAL( tracks( QList< Tomahawk::query_ptr > ) ), this, SLOT( parsedDroppedTracks( QList< Tomahawk::query_ptr > ) ) );
|
connect( dj, SIGNAL( tracks( QList< Tomahawk::query_ptr > ) ), this, SLOT( parsedDroppedTracks( QList< Tomahawk::query_ptr > ) ) );
|
||||||
|
|
||||||
if ( dropType() == DropTypeAllFromArtist )
|
if ( dropType() == DropTypeAllFromArtist )
|
||||||
|
Reference in New Issue
Block a user