KRunner: Improve handling of actions
Open, Needs TriagePublic

Description

Currently they are stored in a map with a string as a key, consequently we have to store the actionId in our runner to find the matching actions in the actionsForMatch method and in some cases to check which action was selected in the run method.

My suggestion would be to use an int instead, this will also allow us to use enums, which is IMO cleaner than handling strings. Also we could define a base enum in the RunnerManager and define values for internal actions. One of those could be the functionality to put the data as a string in the UI, which is currently only possibel with the InformationalMatch. Also functionality like copying text to the clipboard could be handled this way(this is often copy pasted).

Also we could add an actions property to the query match, this way we can set the actions when creating the query match itself, which will also make the D-Bus runners a simpler and cleaner. We could even add this in KF5 and just use the new actions property as a fallback if the actionsForMatch method is not implemented.

Related Objects

alex created this task.Sep 12 2020, 7:47 PM
dfaure renamed this task from Improve handling of actions to KRunner: Improve handling of actions.Sep 13 2020, 8:41 AM
alex added a comment.EditedSep 13 2020, 10:06 AM

I am also thinking that we could have an internal mechanism for actions which automatically provides a context menu like in the notifications

@broulik Had mentioned this idea of integrating this context menu for the the baloo/recent documents runner.

alex added a comment.Sep 19 2020, 7:08 PM
This comment was removed by alex.
alex triaged this task as Wishlist priority.Oct 7 2020, 4:27 PM
alex raised the priority of this task from Wishlist to Needs Triage.
alex moved this task from Backlog to In Progress on the KF6 board.Apr 18 2021, 4:37 PM
alex moved this task from In Progress to Done on the KF6 board.Feb 18 2023, 7:14 PM