RFC: a replacement for KPluginLoader

Kevin Ottens ervin+bluesystems at kde.org
Tue Apr 30 06:10:32 UTC 2013


On Monday 29 April 2013 22:19:58 Aaron J. Seigo wrote:
> i will introduce a new macro (so that it remains source compatible, at least
> for libplasma) that creates a QObject subclass which itself provides a
> factory method to create new instances of the class(es) in the library.
> 
> i would also like to fold in version compatibility checks. the resulting API
> of the generated object will look something like:
> 
> template<class T> T *create(QObject *parent = 0) const;
> bool isVersionCompatible(quint32 minVersion, quint32 maxVersion);
> 
> the version check method will help remove some boilerplate code from the
> library.
> 
> create will be used similarly to how it KPluginLoader is now: create<Foo>()
> 
> the QVariantList parameter will be removed as it seems to serve little real
> world purpose with how we design APIs now.

Sounds good to me. And definitely +1 from me to see the QVariantList go away.
Would be nice to submit that to QtCore, that'd benefit to more places.

Now, to play the devil's advocate... trying to make sure we shuffled all 
options (and because this one didn't occur to me earlier).
Why not reuse KPluginFactory either as is or slightly modified? What we're 
trying to get rid of is K_EXPORT_PLUGIN, kpluginfactory.h includes 
kexportplugin.h but AFAICT it never uses anything from there.

David, opinions on this? AFAIK you did most of the work of moving the plugin 
system in kservice, and from the message K_EXPORT_PLUGIN spits this part seems 
in some kind of limbo. What was your plan there?

Regards.
-- 
Kévin Ottens, http://ervin.ipsquad.net

Sponsored by BlueSystems and KDAB to work on KDE Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130430/2b826234/attachment.sig>


More information about the Kde-frameworks-devel mailing list