The macro K_PLUGIN_FACTORY_DECLARATION_WITH_BASEFACTORY_SKEL defined in kpluginfactory.h takes a parameter baseFactory, which isn't used. Although it's not documented, the name suggests that it should be used when using factories derived from a subclass of KPluginFactory. K_PLUGIN_FACTORY_DECLARATION calls that macro with baseFactory set to KPluginFactory, so that doesn't seem all-too far-fetched. Because it doesn't use baseFactory, using subclasses of KPluginFactory is more work than strictly necessary (e.g. instead of using K_PLUGIN_FACTORY_DECLARATION_WITH_BASEFACTORY_SKEL you need to write out the definition it has, substituting the base class in the right spot).
Git commit daec110942baed6c7e8bcb7684e65411fe8acbe8 by Michael Pyne, on behalf of Adriaan de Groot. Committed on 19/02/2021 at 02:29. Pushed by mpyne into branch 'master'. kpluginfactory: Use the user-provided base factory in our factory macro. The existing macro always inherits from KPluginFactory -- making it hard to use when sub-classing KPluginFactory in order to extend it. The parameter baseFactory to the macro isn't used. Use baseFactory as the base class for the plugin. -- Commentary by committer: This closes out merge request !1. Due to the length of time between when the MR was authored and when we could finally land it, this also includes other commits added as part of the MR to: * Use @-style Doxygen comments consistently * Adapt other Doxygen API documentation to our style guide * Some other miscellaneous editorial improvements On top of those changes, I have ensured that the other changes to this header made in the meantime now conform to the consistent API documentation (i.e. other \ to @ conversions), and to update the @since version to be accurate again. M +148 -117 src/lib/plugin/kpluginfactory.h https://invent.kde.org/frameworks/kcoreaddons/commit/daec110942baed6c7e8bcb7684e65411fe8acbe8