mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
Check mimedata source on osx as Qt::DropAction is not reliable. Also, minor cleanups
This commit is contained in:
@@ -367,8 +367,17 @@ PlaylistModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int r
|
||||
m_dropStorage.action = action;
|
||||
|
||||
DropJob* dj = new DropJob();
|
||||
|
||||
// On mac, drags from outside the app are still Qt::MoveActions instead of Qt::CopyAction by default
|
||||
// so check if the drag originated in this playlist to determine whether or not to copy
|
||||
#ifdef Q_WS_MAC
|
||||
if ( !data->hasFormat( "application/tomahawk.playlist.id" ) ||
|
||||
data->data( "application/tomahawk.playlist.id" ) != m_playlist->guid() )
|
||||
dj->setDropAction( DropJob::Append );
|
||||
#else
|
||||
if ( action & Qt::CopyAction )
|
||||
dj->setDropAction( DropJob::Append );
|
||||
#endif
|
||||
|
||||
connect( dj, SIGNAL( tracks( QList< Tomahawk::query_ptr > ) ), this, SLOT( parsedDroppedTracks( QList< Tomahawk::query_ptr > ) ) );
|
||||
dj->tracksFromMimeData( data );
|
||||
|
@@ -108,7 +108,7 @@ SpotifyParser::lookupSpotifyBrowse( const QString& link )
|
||||
if ( link.contains( "spotify:track" ) )
|
||||
type = DropJob::Track;
|
||||
|
||||
m_browseJob = new DropJobNotifier( pixmap(), QString( "Spotify" ).arg( (int)type ), type, reply );
|
||||
m_browseJob = new DropJobNotifier( pixmap(), "Spotify", type, reply );
|
||||
JobStatusView::instance()->model()->addJob( m_browseJob );
|
||||
|
||||
m_queries.insert( reply );
|
||||
@@ -165,19 +165,12 @@ SpotifyParser::spotifyBrowseFinished()
|
||||
checkTrackFinished();
|
||||
return;
|
||||
}
|
||||
else if ( res.contains( "trackCount" ) && res.value( "trackCount" ).toInt() < 0 )
|
||||
{
|
||||
tLog() << "No tracks' item in the spotify browse result... not doing anything";
|
||||
checkTrackFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
QVariantMap resultResponse = res.value( res.value( "type" ).toString() ).toMap();
|
||||
|
||||
|
||||
if ( !resultResponse.isEmpty() )
|
||||
{
|
||||
|
||||
m_title = resultResponse.value( "name" ).toString();
|
||||
m_single = false;
|
||||
|
||||
|
Reference in New Issue
Block a user