KActionCollection: do we need it really, in Plasma-Framework?
Open, Needs TriagePublic

mart created this task.Nov 23 2019, 11:53 AM
mart added a comment.Nov 23 2019, 11:55 AM

KACtionCollection is the only reason we still depend from kxmlgui

vkrause renamed this task from KACtionCollection: do we need it really? to KActionCollection: do we need it really?.Nov 24 2019, 7:42 PM
dfaure renamed this task from KActionCollection: do we need it really? to KActionCollection: do we need it really, in Plasma-Framework?.Dec 30 2020, 12:09 AM

At quick glance most of it can probably be replaced with a Map<QString, QAction>.

Non-trivial parts are loading/saving shortcuts:

Perhaps we need a utility method to load/save a map of actions to KConfig

Do we allow to configure the shortcuts for applet actions in the UI anywhere?

davidre added a subscriber: davidre.Feb 6 2023, 9:58 AM

Do we allow to configure the shortcuts for applet actions in the UI anywhere?

I don't know of any.

Instead of exposing them as QMap I'd rather add a function that exposes the actions individually, like in https://invent.kde.org/frameworks/kio/-/merge_requests/997

It could be done based on string keys, but for known "standard" actions an enum would be nicer

This could still be backed by a KActionCollection internally, but it would give us more flexibility in the long term by not exposing that in the API

For systemtray's inner containment we'd also need a way to add actions, but that doesn't require exposing the full KActionCollection either

nicolasfella moved this task from In Progress to Done on the KF6 board.Jul 28 2023, 11:56 AM