]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix keyboard navigation issue when Home or End are pressed
authorFrank Reininghaus <frank78ac@googlemail.com>
Tue, 31 Jan 2012 22:12:36 +0000 (23:12 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Tue, 31 Jan 2012 22:12:36 +0000 (23:12 +0100)
The problem was that m_keyboardAnchorIndex and m_keyboardAnchorPos were
not updated when Home or End are pressed. This causes the following
unexpected behavior in Icons View: Press Home, then Right, then Down,
then Home, finally Down. One would expect that the first item in the
second row is the current item then, but before this commit, it was the
second one because the controller still remembered that the second
column was active before Home was pressed.
FIXED-IN: 4.8.1

src/kitemviews/kitemlistcontroller.cpp

index bd37aa964fd247f6c2b3fe464fff705abfc9d35b..e3210dd2223290fa6d4750068b1a67d82145deaf 100644 (file)
@@ -216,10 +216,14 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
     switch (key) {
     case Qt::Key_Home:
         index = 0;
+        m_keyboardAnchorIndex = index;
+        m_keyboardAnchorPos = keyboardAnchorPos(index);
         break;
 
     case Qt::Key_End:
         index = itemCount - 1;
+        m_keyboardAnchorIndex = index;
+        m_keyboardAnchorPos = keyboardAnchorPos(index);
         break;
 
     case Qt::Key_Left: