Skip to content
Commit e3dcd215 authored by Alexander Lohnau's avatar Alexander Lohnau
Browse files

runners/recentdocuments: Improve performance and fix memleak

We would allocate a new ResultModel without deleting prior ones after
use. By putting this in a unique_ptr, we can reset it for each query and
also in the teardown slot.

The optimzation is to reuse the results from the previous query, in case
we only appended to the same term. Because runners are now in their own
thread, we don't have to worry about our member being accessed by
multiple threads at the same time.

Requires https://invent.kde.org/frameworks/kactivities-stats/-/merge_requests/39
in order for the limit to work correctly. On my setup, I never got more
than the 20 results after typing a few characters, but better be safe.
parent 0a2efa93
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment