diff --git a/src/libtomahawk/dropjob.cpp b/src/libtomahawk/dropjob.cpp index de6666b7a..95b9a4aa1 100644 --- a/src/libtomahawk/dropjob.cpp +++ b/src/libtomahawk/dropjob.cpp @@ -370,6 +370,9 @@ DropJob::handleXspf( const QString& fileUrl ) { tDebug() << Q_FUNC_INFO << "Got xspf playlist!!" << fileUrl; + if ( dropAction() == Default ) + setDropAction( Create ); + // Doing like so on *nix, dont know really how files are // passed on others. // TODO look in to! @@ -395,6 +398,9 @@ DropJob::handleSpPlaylist( const QString& url ) playlistUri = "spotify:" + playlistUri; } + if ( dropAction() == Default ) + setDropAction( Create ); + tDebug() << "Got a spotify playlist uri in dropjob!" << playlistUri; SpotifyParser* spot = new SpotifyParser( playlistUri, dropAction() == Create, this ); diff --git a/src/libtomahawk/dropjob.h b/src/libtomahawk/dropjob.h index 47b7e18a2..e45b0ff17 100644 --- a/src/libtomahawk/dropjob.h +++ b/src/libtomahawk/dropjob.h @@ -56,7 +56,8 @@ public: Q_DECLARE_FLAGS(DropTypes, DropType) enum DropAction { - Append = 0, + Default = 0, + Append, Create }; diff --git a/src/libtomahawk/playlist/playlistmodel.cpp b/src/libtomahawk/playlist/playlistmodel.cpp index 41f7af7b5..6904d6962 100644 --- a/src/libtomahawk/playlist/playlistmodel.cpp +++ b/src/libtomahawk/playlist/playlistmodel.cpp @@ -366,6 +366,8 @@ PlaylistModel::dropMimeData( const QMimeData* data, Qt::DropAction action, int r m_dropStorage.parent = QPersistentModelIndex( parent ); m_dropStorage.action = action; DropJob *dj = new DropJob(); + dj->setDropAction( DropJob::Append ); + connect( dj, SIGNAL( tracks( QList< Tomahawk::query_ptr > ) ), this, SLOT( parsedDroppedTracks( QList< Tomahawk::query_ptr > ) ) ); dj->tracksFromMimeData( data ); diff --git a/src/sourcetree/sourcetreeview.cpp b/src/sourcetree/sourcetreeview.cpp index 9a86a462c..4786a77cb 100644 --- a/src/sourcetree/sourcetreeview.cpp +++ b/src/sourcetree/sourcetreeview.cpp @@ -529,7 +529,7 @@ SourceTreeView::dropEvent( QDropEvent* event ) } else { - // In current event, parse sourceTreeView mime instead of playlistitems + // if it's a playlist drop, accept it anywhere in the sourcetree by manually parsing it. qDebug() << Q_FUNC_INFO << "Current Event"; DropJob *dropThis = new DropJob; dropThis->setDropTypes( DropJob::Playlist );