plugin loading (was: kcmoduleinfo / Plugin linking problem)

Matthias Kretz kretz at kde.org
Sun Aug 12 15:32:30 BST 2007


On Sunday 12 August 2007, Rafael Fernández López wrote:
> Apart from my known opinion that this code is a bit more
> "disorganized",

"disorganized" because there's not one factory per plugin?

> I find the solution quite good, but I think that once 
> that we have more than one plugin or whatever, all of them should have
> keyword.

This could be implemented to be enforced at runtime. So
K_PLUGIN_FACTORY(Factory,
        K_REGISTER_PLUGIN(A, MyPlugin);
        K_REGISTER_PLUGIN(B, MyPlugin);
        )
would fail,
K_PLUGIN_FACTORY(Factory,
        K_REGISTER_PLUGIN(A, MyPlugin);
        K_REGISTER_PLUGIN_WITH_KEYWORD(B, MyPlugin, "bar");
        )
would also fail, only
K_PLUGIN_FACTORY(Factory,
        K_REGISTER_PLUGIN_WITH_KEYWORD(A, MyPlugin, "foo");
        K_REGISTER_PLUGIN_WITH_KEYWORD(B, MyPlugin, "bar");
        )
would work

> From my point of view, probably all of them should require
> K_REGISTER_PLUGIN_WITH_KEYWORD.

I believe the more common case is one plugin per DSO or perhaps two plugins 
with different interface. Having different plugins of the same interface is 
the less common case.

So optimizing for the common case I'd like to not require a keyword.

> Are there any real chances of moving this or a variation of this code
> into kdelibs ?

I can work on this a bit next week and add is as an additional plugin loading 
solution for the time being.

Whether we want to remove K_EXPORT_COMPONENT_FACTORY and K_TYPELIST_* and the 
KGenericFactory is another question. And I'm not prepared to answer that one 
with "remove" yet...

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070812/6d73b1c8/attachment.sig>


More information about the kde-core-devel mailing list