mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
Create a new playlist from a spotify playlist if dropped anywhere on the sourcetree
Only generate the tracks directly if dragged into a playlist contents
This commit is contained in:
parent
bf009c8854
commit
5b48442006
@ -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 );
|
||||
|
||||
|
@ -56,7 +56,8 @@ public:
|
||||
Q_DECLARE_FLAGS(DropTypes, DropType)
|
||||
|
||||
enum DropAction {
|
||||
Append = 0,
|
||||
Default = 0,
|
||||
Append,
|
||||
Create
|
||||
};
|
||||
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user