[Amarok] Improve dynamic playlist's behaviour on track chan

Mark Kretschmann kretschmann at kde.org
Mon Nov 16 19:50:20 CET 2009


On Fri, Nov 13, 2009 at 6:51 AM, Rick W. Chen <stuffcorpse at archlinux.us> wrote:
> commit 4beff9b8bbfc4b1a67f26b214aaf0bf12df087da
> Author:     Rick W. Chen <stuffcorpse at archlinux.us>
> AuthorDate: Fri Nov 13 18:43:07 2009 +1300
> Commit:     Rick W. Chen <stuffcorpse at archlinux.us>
> CommitDate: Fri Nov 13 18:43:07 2009 +1300
>
>    Improve dynamic playlist's behaviour on track change
>
>    Consider a dynamic playlist with 2 Previous tracks:
>
>    track 1
>    track 2
>    active track
>    track 4
>    track 5
>    track 6
>
>    Previously if you double click on anything after track 4,  every track in
>    between would be skipped (put behind the active track, as if they have
>    already been played). Now, the selected track would be moved to the active
>    position and the rest are kept in place. And similarly for tracks that
>    before the active position.
>
> diff --git a/src/playlist/PlaylistController.cpp b/src/playlist/PlaylistController.cpp
> index 1cf5c95..0a0a638 100644
> --- a/src/playlist/PlaylistController.cpp
> +++ b/src/playlist/PlaylistController.cpp
> @@ -333,7 +333,7 @@ Playlist::Controller::moveRow( int from, int to )
>     QList<int> source;
>     QList<int> target;
>     source.append( from );
> -    source.append( to );
> +    target.append( to );
>
>     // shift all the rows between
>     if ( from < to )
> diff --git a/src/playlist/navigators/DynamicTrackNavigator.cpp b/src/playlist/navigators/DynamicTrackNavigator.cpp
> index 0e242b1..eacdc8d 100644
> --- a/src/playlist/navigators/DynamicTrackNavigator.cpp
> +++ b/src/playlist/navigators/DynamicTrackNavigator.cpp
> @@ -98,6 +98,14 @@ Playlist::DynamicTrackNavigator::activePlaylistChanged()
>  void
>  Playlist::DynamicTrackNavigator::trackChanged()
>  {
> +    const int activeRow = m_model->activeRow();
> +    const int previousTracks = AmarokConfig::previousTracks();
> +
> +    if( activeRow < previousTracks )
> +        Controller::instance()->moveRow( activeRow, previousTracks );
> +    else if( activeRow > previousTracks )
> +        Controller::instance()->moveRow( activeRow, previousTracks + 1 );
> +
>     appendUpcoming();
>     removePlayed();
>  }

Is there any chance that your commit could be related to this:

https://bugs.kde.org/show_bug.cgi?id=214759

-- 
Mark Kretschmann
Amarok Developer
www.kde.org - amarok.kde.org


More information about the Amarok-devel mailing list