Do not sort twice when changing role and order at the same time
ClosedPublic

Authored by thsurrel on Nov 22 2018, 9:30 PM.

Details

Summary

When using the list header to change the role and order, if one
changes the order to descending and then changes role, dolphin
also changes the order back to ascending. This results in sorting
the list of files twice in a row. This patch removes the first
(useless) sort.

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
thsurrel created this revision.Nov 22 2018, 9:30 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptNov 22 2018, 9:30 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
thsurrel requested review of this revision.Nov 22 2018, 9:30 PM
elvisangelaccio requested changes to this revision.Nov 25 2018, 10:18 AM
elvisangelaccio added a subscriber: elvisangelaccio.
elvisangelaccio added inline comments.
src/kitemviews/kfileitemmodel.cpp
841

Please remove, this will only add noise.

And you could accomplish the same goal by properly setting your QT_MESSAGE_PATTERN variable.

src/kitemviews/kitemmodelbase.h
84–89

Please update the apidox. It should say that the implementation should resort only if resortItems is true.

263–271

Same here, the apidox needs to be updated.

src/kitemviews/private/kitemlistheaderwidget.cpp
223–224

How about calling the variable resetSortOrder ?

See 2854a69fcad54d394ebec504af4995dcb5e18ac4

This revision now requires changes to proceed.Nov 25 2018, 10:18 AM
thsurrel updated this revision to Diff 46276.Nov 26 2018, 4:46 PM

Fixes as per elvisangelaccio comments
Thanks for the review!

thsurrel marked 4 inline comments as done.Nov 26 2018, 4:46 PM
elvisangelaccio accepted this revision.Dec 1 2018, 4:13 PM
This revision is now accepted and ready to land.Dec 1 2018, 4:13 PM
This revision was automatically updated to reflect the committed changes.