Review Request 112561: Ensure that the items are sorted correctly when the refreshItems() signal is received

Frank Reininghaus frank78ac at googlemail.com
Fri Sep 6 16:29:54 BST 2013


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

Review request for Dolphin.


Description
-------

A side-effect of https://git.reviewboard.kde.org/r/111146/ is that the model is sometimes not sorted correctly after a refreshItems() signal has been received:

1. mkdir test && cd test && touch a b c && dolphin .
2. Sort by size -> the order of the items is "a b c" because the name is used as a fallback (all files have zero size).
3. Rename "a" -> "d", either using non-inline renaming or in another view (such that the model receives the refreshItems() signal).
4. Note that the items are not resorted.

This patch fixes the problem. I've factored out some code that was added in https://git.reviewboard.kde.org/r/111721/ to a new function, such that both setData() and slotRefreshItems() can make use of it.

I added a unit test for the bug and another one for the grouping problem that Emmanuel found in the first version of https://git.reviewboard.kde.org/r/111721/


Diffs
-----

  dolphin/src/kitemviews/kfileitemmodel.h 5917e68 
  dolphin/src/kitemviews/kfileitemmodel.cpp 7bbc1d1 
  dolphin/src/tests/kfileitemmodeltest.cpp f843978 

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


Testing
-------

Works. Old and new unit tests pass.


Thanks,

Frank Reininghaus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130906/13999d3f/attachment.htm>


More information about the kfm-devel mailing list