diff --git a/src/libtomahawk/dropjob.cpp b/src/libtomahawk/dropjob.cpp index 8a7b85ca1..4a557a6f5 100644 --- a/src/libtomahawk/dropjob.cpp +++ b/src/libtomahawk/dropjob.cpp @@ -465,7 +465,6 @@ DropJob::handleM3u( const QString& fileUrls ) { tDebug() << Q_FUNC_INFO << "Trying to append contents from" << urls; connect( m, SIGNAL( tracks( QList ) ), this, SLOT( onTracksAdded( QList< Tomahawk::query_ptr > ) ) ); - } m_queryCount++; diff --git a/src/libtomahawk/dropjob.h b/src/libtomahawk/dropjob.h index 2bee71afd..eda72504e 100644 --- a/src/libtomahawk/dropjob.h +++ b/src/libtomahawk/dropjob.h @@ -62,7 +62,8 @@ public: enum DropAction { Default = 0, Append, - Create + Create, + Move }; /** diff --git a/src/libtomahawk/playlist/playlistmodel.cpp b/src/libtomahawk/playlist/playlistmodel.cpp index bd2744232..d35aa017c 100644 --- a/src/libtomahawk/playlist/playlistmodel.cpp +++ b/src/libtomahawk/playlist/playlistmodel.cpp @@ -331,18 +331,17 @@ PlaylistModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int r dj->setDropTypes( DropJob::Track | DropJob::Playlist | DropJob::Artist | DropJob::Album ); dj->setDropAction( DropJob::Append ); +/* if ( action & Qt::MoveAction ) + dj->setDropAction( DropJob::Move ); */ +#ifdef Q_WS_MAC // 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" ) || ( !m_playlist.isNull() && 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 > ) ), SLOT( parsedDroppedTracks( QList< Tomahawk::query_ptr > ) ) ); @@ -373,6 +372,9 @@ PlaylistModel::parsedDroppedTracks( QList< query_ptr > tracks ) beginPlaylistChanges(); insert( tracks, beginRow ); + + if ( update && m_dropStorage.action & Qt::CopyAction ) + endPlaylistChanges(); } m_dropStorage.parent = QPersistentModelIndex();