Bug 410851 - K_PLUGIN_FACTORY_DECLARATION_WITH_BASEFACTORY_SKEL doesn't use basefactory
Summary: K_PLUGIN_FACTORY_DECLARATION_WITH_BASEFACTORY_SKEL doesn't use basefactory
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kcoreaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.61.0
Platform: Other FreeBSD
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-12 14:25 UTC by groot
Modified: 2021-02-19 02:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description groot 2019-08-12 14:25:53 UTC
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).
Comment 1 Michael Pyne 2021-02-19 02:38:30 UTC
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