D8822: Fix scrolling during inline renaming causes rename of wrong file
Henrik Fehlauer
noreply at phabricator.kde.org
Thu Nov 16 13:45:28 GMT 2017
rkflx added a comment.
In https://phabricator.kde.org/D8822#168476, @akrutzler wrote:
> 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!
@akrutzler Thanks for the analysis, sounds like you are onto another fix :) If you are interested (if not, I can also recommend a few Gwenview bugs): https://bugs.kde.org/show_bug.cgi?id=334533#c7
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/6600c825/attachment.htm>
More information about the kfm-devel
mailing list