Summary: | Multiple selection of files using the "shift key" selects wrong files! | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Patrick Tanz <p1703> |
Component: | view-engine: details mode | Assignee: | Peter Penz <peter.penz19> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | frank78ac |
Priority: | NOR | Keywords: | investigated |
Version: | 16.12.2 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.8.0 | |
Sentry Crash Report: | |||
Attachments: |
Qt-only testcase
Possible patch (first try) |
Description
Patrick Tanz
2011-01-09 11:10:48 UTC
Thanks for your bug report. How exactly do you select the first file? Do you really just click it (in this case, you've probably enabled the "double-click" mode, i.e., open files with a double-click), do you click on the selection marker ("+") on the file icon, or do you Control-click it? Yes, I'm using doubleclick mode for opening files. So I initially selected the file by a single click on the file name. For the second click after creating the new files, I held the shift key and clicked again on the file name of a file some positions below to select all files between first and second click. I could reproduce the issue: - It happens only if double-click is used - It occurs in all views (I still leave it assigned to "details-view" though) I can also reproduce it in single-click mode if I Control-click the first item. Another way to reproduce is by resorting: Control-click an item, change the sort order, Shift-click another item. I think that this must be fixed in QAbstractItemView. This class keeps the position of the first clicked item in its private member d->pressedPosition. This member is not updated when the position of the item changes. One possibility might be to use a QPersistentModelIndex to keep track of the item which has been clicked first. Created attachment 57628 [details]
Qt-only testcase
Created attachment 57629 [details]
Possible patch (first try)
This patch fixes it for me, but unfortunately, it breaks an existing unit test (tst_QTableView::taskQTBUG_4516_clickOnRichTextLabel), so it seems that some more work is required.
I've created an upstream bug report: http://bugreports.qt.nokia.com/browse/QTBUG-18009 In KDE 4.8, Dolphin's view engine will not be based on Qt's item views anymore. This enables us to fix this issue on our own :-) I'll push a commit that fixes this problem in a minute. Git commit fae7b960e209d47159ea7ef94be95b0cedd6af68 by Frank Reininghaus. Committed on 10/08/2011 at 10:38. Pushed by freininghaus into branch 'master'. Update the anchor item when items are added or removed If items are added or removed in the model, not only the current item, but also the anchor item, which is the starting point for any selections via Shift+Click or Shift+Key, needs to be updated. BUG: 262638 FIXED-IN: 4.8.0 M +30 -0 dolphin/src/kitemviews/kitemlistselectionmanager.cpp M +36 -0 dolphin/src/tests/kitemlistselectionmanagertest.cpp http://commits.kde.org/kde-baseapps/fae7b960e209d47159ea7ef94be95b0cedd6af68 |