From kde-commits Tue Jan 31 22:53:39 2012 From: Frank Reininghaus Date: Tue, 31 Jan 2012 22:53:39 +0000 To: kde-commits Subject: [kde-baseapps] dolphin/src/kitemviews: Fix keyboard navigation issue when Home or End are pressed Message-Id: <20120131225339.35D96A60A6 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=132805061726100 Git commit d03f1357c0509ea5204b578f40ccc203e7d5ee40 by Frank Reininghaus. Committed on 31/01/2012 at 23:12. Pushed by freininghaus into branch 'master'. Fix keyboard navigation issue when Home or End are pressed 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. (cherry picked from commit 999234a94ae41cfb4f2167d2779b562ebf8127ce) M +4 -0 dolphin/src/kitemviews/kitemlistcontroller.cpp http://commits.kde.org/kde-baseapps/d03f1357c0509ea5204b578f40ccc203e7d5ee40 diff --git a/dolphin/src/kitemviews/kitemlistcontroller.cpp b/dolphin/src/k= itemviews/kitemlistcontroller.cpp index bd37aa9..e3210dd 100644 --- a/dolphin/src/kitemviews/kitemlistcontroller.cpp +++ b/dolphin/src/kitemviews/kitemlistcontroller.cpp @@ -216,10 +216,14 @@ bool KItemListController::keyPressEvent(QKeyEvent* ev= ent) switch (key) { case Qt::Key_Home: index =3D 0; + m_keyboardAnchorIndex =3D index; + m_keyboardAnchorPos =3D keyboardAnchorPos(index); break; = case Qt::Key_End: index =3D itemCount - 1; + m_keyboardAnchorIndex =3D index; + m_keyboardAnchorPos =3D keyboardAnchorPos(index); break; = case Qt::Key_Left: