X-KDE-PluginKeyword allows to instantiate multiple classes from a single plugin binary. It is very rarely used, mostly for having multiple KCMs sharing a single plugin binary.
This forces us to go through KServiceTypeTrader/desktop file based loading for loading KCMs. If we could assume that there is only one KCM per plugin binary we can simplify this and just use KCoreAddons API to load KCMs.
I ported some trivial/unneeded usages. Non-trivial usages left are in:
- Konqueror
- KIO: https://invent.kde.org/frameworks/kio/-/merge_requests/516
- KInfoCenter
Those need to be ported to have a plugin per KCM, which is not hard but a bit of boilerplate.
There is also some unorthodox usage in KWin. There a generic KCM binary is loaded for some scripts/effects that then uses the plugin keyword to load the relevant UI. Those need a bit of thinking. We could for example pass the relevant parameter in the args when instantiating the plugin