mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
support moving to beginning
This commit is contained in:
@@ -379,20 +379,28 @@ SpotifyPlaylistUpdater::spotifyTracksMoved( const QVariantList& tracks, const QS
|
|||||||
|
|
||||||
|
|
||||||
// Find the position of the track to insert from
|
// Find the position of the track to insert from
|
||||||
for ( QList< plentry_ptr >::iterator iter = entries.begin(); iter != entries.end(); ++iter )
|
if ( newStartPos.isEmpty() )
|
||||||
{
|
{
|
||||||
if ( (*iter)->annotation() == newStartPos )
|
while ( !toMove.isEmpty() )
|
||||||
|
entries.prepend( toMove.takeLast() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for ( QList< plentry_ptr >::iterator iter = entries.begin(); iter != entries.end(); ++iter )
|
||||||
{
|
{
|
||||||
++iter;
|
if ( (*iter)->annotation() == newStartPos )
|
||||||
while ( !toMove.isEmpty() )
|
|
||||||
{
|
{
|
||||||
qDebug() << "Adding moved track to playlist at pos (end:" << (iter == entries.end());
|
++iter;
|
||||||
if ( iter != entries.end() )
|
while ( !toMove.isEmpty() )
|
||||||
qDebug() << (*iter)->query()->track() << (*iter)->query()->artist();
|
{
|
||||||
iter = entries.insert( iter, toMove.takeLast() );
|
qDebug() << "Adding moved track to playlist at pos (end:" << (iter == entries.end());
|
||||||
}
|
if ( iter != entries.end() )
|
||||||
|
qDebug() << (*iter)->query()->track() << (*iter)->query()->artist();
|
||||||
|
iter = entries.insert( iter, toMove.takeLast() );
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user