[KFind] Natural auto-scrolling during new items insertion into search results view
ClosedPublic

Authored by pdabrowski on Jul 19 2019, 1:17 AM.

Details

Summary

When new results are added to the list, ensure KFind continues to display the results that user has scrolled to or selected.

Finally no more partial results constantly running away from cursor...

Diff Detail

Repository
R228 KFind
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
pdabrowski requested review of this revision.Jul 19 2019, 1:17 AM
pdabrowski created this revision.
davidedmundson added inline comments.
src/kfindtreeview.cpp
400

Given this method is potentially called a lot it would be good to optimise it.

We can return early with an empty list if selectedIndexes is empty.

427

Rather than mapping to the source and back, it's safer to convert this to a QPersistentModelIndex, otherwise we're just relying on the assumption that the source model only appends.

pdabrowski marked 2 inline comments as done.Jul 19 2019, 10:04 PM
pdabrowski added inline comments.
src/kfindtreeview.cpp
400

Good catch, thanks.

pdabrowski marked an inline comment as done.
davidedmundson accepted this revision.Jul 19 2019, 10:12 PM
This revision is now accepted and ready to land.Jul 19 2019, 10:12 PM
ngraham accepted this revision.Jul 20 2019, 2:25 AM
ngraham added a subscriber: broulik.

LGTM too.

@broulik, the KAboutData says you're the maintainer. Are you good with this?

pdabrowski added inline comments.
src/kfindtreeview.cpp
30

fixed: includes in alphabetical order

pdabrowski marked an inline comment as done.Jul 20 2019, 12:28 PM
This revision was automatically updated to reflect the committed changes.