Version: 1.2.1 (using 4.2.4 (KDE 4.2.4), Debian packages) Compiler: cc OS: Linux Reproducing: You've e.g. the following files in your directory: a b c d e f g * Switch the view to «Details». * Click on a (a will be selected). * Press f (f will be selected, and _nothing else_). * Press Shift-Down (arrow). Quiz: What will be selected now? No. Not f and and the next file, g, but all files.
Thanks for the bug report! I can reproduce this and agree that this is not the expected behaviour. That should most likely be fixed in Qt - I think it's somewhat related to, but not exactly a duplicate of, bug 163451. Maybe I'll try to come up with a fix and submit this to Qt Software when I find some time.
It seems that this is not a Qt issue after all - the simple patch below appears to fix it for me. @Peter: was there a reason to use selectionModel()->select(...) to select the current item and not QAbstractItemView::setCurrentIndex(...), or is it OK to commit this patch? Only QAbstractItemView::setCurrentIndex updates QAbstractItemViewPrivate's pressedPosition member, which points to the item which is the starting point for the next Shift-selection. BTW, I don't really understand at the moment why this sort of keyboard selection is handled differently in QTreeView and QListView, but there's probably a reason for that... Index: src/dolphindetailsview.cpp =================================================================== --- src/dolphindetailsview.cpp (revision 1021034) +++ src/dolphindetailsview.cpp (working copy) @@ -421,7 +421,7 @@ // Stay consistent with QListView: When changing the current index by key presses, // also change the selection. if (m_keyPressed) { - selectionModel()->select(current, QItemSelectionModel::ClearAndSelect); + setCurrentIndex(current); } }
@Frank: Not using selectionModel()->select(...) might be a relict when we tried different versions of the autoscroller, I'm not sure... I currently have no time for coding + testing the patch, but I'd say please commit the patch as setCurrentIndex() is the obvious choice. Thanks!
I've just tried the patch. I've tried to work a bit and to some test and I've see no side effects.
SVN commit 1021267 by freininghaus: Fix selection in the Details view in the following use case: 1. Ctrl-click item 1. 2. Enter the first letter of item 2, such that it will be selected and the new current item. 3. Shift-click item 3. With this commit, all items between 2 and 3 will be selected, as expected, and not all items between 1 and 3. BUG: 201459 M +1 -1 dolphindetailsview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1021267
SVN commit 1021269 by freininghaus: Fix selection in the Details view in the following use case: 1. Ctrl-click item 1. 2. Enter the first letter of item 2, such that it will be selected and the new current item. 3. Shift-click item 3. With this commit, all items between 2 and 3 will be selected, as expected, and not all items between 1 and 3. Fix will be in KDE 4.3.1. CCBUG: 201459 M +1 -1 dolphindetailsview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1021269
Thank you!
(In reply to comment #6) > Fix will be in KDE 4.3.1. Sorry, that was 4.3.2, of course ;-)