Bug 225791 - after starting playing "up" or "down"-keys jumps to the first playlist entry
Summary: after starting playing "up" or "down"-keys jumps to the first playlist entry
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlist (show other bugs)
Version: 2.2.2
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-07 03:49 UTC by Kostya Sha
Modified: 2010-02-24 15:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kostya Sha 2010-02-07 03:49:19 UTC
Version:            (using KDE 4.3.5)
OS:                Linux
Installed from:    Gentoo Packages

1. add songs to amarok playlist
2. Double click on the song in the middle of playlist
3. press "up" or "down" key
It jumps to the first playlist entry.

Expected:
Go to +/- entry from current playing now.
Amarok 2.2.2
Comment 1 Dan Meltzer 2010-02-07 04:35:42 UTC
This looks like a bug in our keeping the selection model in sync...
Comment 2 Nikolaj Hald Nielsen 2010-02-24 15:54:32 UTC
commit c6fccef763abfc752e1d11a81a7ff8b419db473c
Author: Nikolaj Hald Nielsen <nhn@kde.org>
Date:   Wed Feb 24 15:49:28 2010 +0100

    Set the "current index" to the activated row, when activating a row in the playlist. This prevents keyboard navigation going astray when starting playback of a track.
    
    BUG: 225791

diff --git a/src/playlist/view/listview/PrettyListView.cpp b/src/playlist/view/listview/PrettyListView.cpp
index f36b3a1..4e9f415 100644
--- a/src/playlist/view/listview/PrettyListView.cpp
+++ b/src/playlist/view/listview/PrettyListView.cpp
@@ -254,6 +254,11 @@ Playlist::PrettyListView::trackActivated( const QModelIndex& idx )
     DEBUG_BLOCK
     m_skipAutoScroll = true; // we don't want to do crazy view changes when selecting an item in the view
     Actions::instance()->play( idx );
+
+    //make sure that the track we just activated is also set as the current index or
+    //the selected index will get moved to the first row, making keyboard navigation difficult (BUG 225791)
+    selectionModel()->setCurrentIndex( idx, QItemSelectionModel::ClearAndSelect );
+    
 }
 
 void