[PATCH] kcmoduleinfo [WAS] Plugin linking problem

David Faure faure at kde.org
Fri Aug 10 13:30:13 BST 2007

On Friday 10 August 2007, Simon Hausmann wrote:
> On Friday 10 August 2007 10:41:16 Matthias Kretz wrote:
> > On Friday 10 August 2007, Rafael Fernández López wrote:
> > > Adapting more *.desktop files (now on kdepim) I see that on this module
> > > this is pretty common. For example, note that:
> >
> > Yes, one could probably say that kdepim is the reason X-KDE-FactoryName
> > exists.
> >
> > The right solution IMHO would be to have still one entry point though that
> > returns one factory object but this one factory then creates the X
> > different KCMs. Somehow it sounds wrong to me to have one library with X
> > different factories to instantiate a plugin class.
> That's exactly what I was thinking, too.

In fact I don't think it's wrong to have X different factories, because it keeps the code much more modular.
You can just link together your kcontrol module code and your ktexteditor code plugin code,
without the need for those two pieces of code to know about each other.
If you had to create one mega-factory which can create both kinds of things, then you need
to tie them together at the code level, making future refactorings more difficult.

> I don't mind the option of suppressing the run-time warning though. It's not a 
> real error/problem anyway.

Actually I think it's a bug in the current code that the factoryname is ignored when trying
to open the plugin as a qt-like plugin, isn't it?
I would suggest the attached patch [untested, except for compilation and running the unit test].
But we have to check if sometimes the factory name isn't passed even from code that
would in fact load a qt-like plugin...
+ and we should also rename this "kde3" in the name, if we undeprecate this mechanism ;)

David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: klibloader.cpp.diff
Type: text/x-diff
Size: 1647 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070810/220a8c06/attachment.diff>

More information about the kde-core-devel mailing list