Skip to content

Refactor context menu loading and make it more scalable

Alexander Lohnau requested to merge work/new_contextmenu_loading into master

Currently the services and plugins have their own methods in order to be added to the menu. This way actions from plugins can not be added to the "Actions" submenu. This is especially problematic, because the top-level menu is very cluttered and some entries fit better in the "Actions" submenu.

The new method also an optional parameter for additional actions that can not be a static service menu and are not worth/possible to implement as a plugin.

And on the opposite side we can have the case where we want to exclude certain plugins. For example in Krusader the ark context menu plugin is shown, but there are already actions in the toolbar implemented that handle the exact same usecase. image

Also I have played with the though of providing context menu actions through D-Bus, similar to the D-Bus runners in KRunner. With this in mind the current state would not scale well.

Also I have explicitly chosen void for the return type, because the returned value is ignored in all usages.

Leaving the TODO in, because this MR ist for the most part about about reorganizing the existing logic. Everything else would make the review unnecessarily hard :) I will finish this once this MR got merged.

@dfaure

Merge request reports