Ensure that the items are sorted correctly when the refreshItems() signal is received

Review Request #112561 - Created Sept. 6, 2013 and submitted

Information
Frank Reininghaus
kde-baseapps
KDE/4.11
Reviewers
dolphin
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/
Works. Old and new unit tests pass.
Emmanuel Pescosta
Emmanuel Pescosta
Commit Hook
Frank Reininghaus
Review request changed

Status: Closed (submitted)

Loading...