Skip to content

Pass KPluginMetaData instance to plugins, fix mix-up of component name & id

The IPlugin constructor has been trying to use the KXMLGUI componentName to query the plugin metadata from the plugincontroller.

KXMLGUI componentName and KPlugin id are identifiers from independent systems. There is no guarantee those match. And with some plugins indeed there is a mismatch, so the query fails there.

The constructors of the actual plugin classes are called from KPluginFactory. For that to work they must conform to one of certain constructors argument signatures.

Since KF 5.77 KPluginFactory supports also a constructor signature with additionally has a KPluginMetaData arg. For that arg the meta data instance which the loading mechanism fetched from the embedded JSON metadata would be passed.

Switching all KDevelop plugins to use this API variant and changing the IPlugin constructor to take the respective KPluginMetaData instance allows to stop trying to query the plugincontroller and instead have the wanted data already around.

For tests where the plugin class instance is manually created and not loaded from a plugin binary with embedded JSON metadata, the KPluginMetaData has to be created manually.

Adaptions needed in external plugins:

Edited by Friedrich W. H. Kossebau

Merge request reports