Skip to content

Draft: New API for history and match counts

Alexander Lohnau requested to merge work/new_history_api into master

The old system had some issues: The history was managed by the KRunner executable. This makes difficult to reuse the entries in other frontends. Also the launchCounts needed to be saved, which forced us to save the config twice.

Another big issue is that we could not tell how often each runner was queried. We would only get the id of the match.

With the proposal we would be able to save and manage the history in the RunnerManager and also be able to tell how often each runner and match of this runner has been queried. This is a requirement for sorting the runners on how often they were used.
This MR does not change this, but provides the necessary data to do so.

The old config looks like:

[General]
history=firefox

[PlasmaRunnerManager]
LaunchCounts=1 shell_firefox,1 services_applications:firefox.desktop

The new one would look like:

[PlasmaRunnerManager]
history=firefox

[PlasmaRunnerManager][services]
launchCount=1
services_applications:firefox.desktop=1

[PlasmaRunnerManager][shell]
launchCount=1
shell_firefox=1

Especially if we are going to use the match id to avoid duplicate results from multiple runners(like baloo and recent documents) we should make sure that we don't have some kind of messy string splitting in our config.

One issue looking forward to plasma 5.21: We want to enable all our runners in Kickoff and use the config from the krunnerrc file. This means that two processes are writing to this file, which can be problematic if they override each others config.

Edited by Alexander Lohnau

Merge request reports