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
Please register or sign in to comment