Review Request 112756: KLinkItemSelectionModel: Do not change current index of mapped model if the mapped one is invalid

Commit Hook null at kde.org
Tue Sep 24 16:42:13 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112756/
-----------------------------------------------------------

(Updated Sept. 24, 2013, 3:42 p.m.)


Status
------

This change has been marked as submitted.


Review request for kdelibs and Stephen Kelly.


Description
-------

I noticed Gwenview keyboard navigation broke with the latest KLinkItemSelectionModel changes: in browse mode, in a folder which contains both folders and images, something like this:

dir1 dir2 img1 img2

if img1 is selected, pressing the left arrow makes dir1 selected instead of dir2.

This can be explain as so: given the following 
model A with content: 
0. dir1
1. dir2
2. img1
3. img2

model B a proxy model on A with content:
0. img1
1. img2


AView and BView, views on each models and a KLinkItemSelectionModel to link selections between AView and BView.

Setting current index in AView to row 1, which does not exist in BView, currently causes KLinkItemSelectionModel to set BView current index to invalid, which in turns cause KLinkItemSelectionModel to set AView current index to invalid.

Patch in this request prevents invalid indexes from being propagated. I am not sure it is the best behavior though: maybe we don't want to propagate invalid indexes, unless the original index is invalid itself? If I set current index of AView to invalid, maybe BView current index should become invalid as well? I am happy to implement this alternate behavior if you think it's better.


Diffs
-----

  kdeui/itemviews/klinkitemselectionmodel.cpp be8395f 
  kdeui/tests/klinkitemselectionmodeltest.cpp 91540fd 

Diff: http://git.reviewboard.kde.org/r/112756/diff/


Testing
-------

Existing test case has been extended to test behavior in case of invalid indexes. Gwenview keyboard behavior is not broken anymore.


Thanks,

Aurélien Gâteau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20130924/87e6eac1/attachment.htm>


More information about the kde-core-devel mailing list