D8822: Rename inline: scrolling causes rename of wrong file
Andreas Krutzler
noreply at phabricator.kde.org
Thu Nov 16 13:29:03 GMT 2017
akrutzler added a comment.
In https://phabricator.kde.org/D8822#168268, @rkflx wrote:
> I still don't understand what is the actual problem in the bug, but at least it is not triggered anymore and the floating text input field is gone.
The actual problem behind this is an "miscommunication" between View and Model. If you want to rename something, you tell the `KItemListView` to change the `text`-role of one of its items by calling `KItemListView::editRole(int index, const QByteArray& role)`. `index` defines which item to change. But this `index` is **not persistent**! Once you scroll through the list, that `index` may change (because of some performance optimizations in `KItemListView::doLayout()`i guess). Because of this, the index of an Item in the `View` **differs** from the index in the `Model`(where necessary data like the URL is stored). But by design they **must** stay the same!
In https://phabricator.kde.org/D8822#168452, @elvisangelaccio wrote:
> Can you try to use the event filter in KItemListRoleEditor instead? It should be enough to also check for the `QEvent::Wheel` event.
> It seems to work for me and the patch becomes much simpler.
I tried to catch the QEvent::Wheel event in KStandardItemListWidget but of course that doesn't work because KItemListRoleEditor has focus. If that works, this patch should be very simple thanks :) Maybe I'll make it until tonight.
REPOSITORY
R318 Dolphin
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D8822
To: akrutzler, ngraham, rkflx, #dolphin
Cc: elvisangelaccio, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20171116/f0f9ae2a/attachment.htm>
More information about the kfm-devel
mailing list