[PATCH] kcmoduleinfo [WAS] Plugin linking problem

Matthias Kretz kretz at kde.org
Fri Aug 10 09:41:16 BST 2007


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.
Anyway, I implemented a solution for KCMs: 
http://api.kde.org/4.0-api/kdelibs-apidocs/kutils/html/classKCModuleFactory.html
Perhaps this should be a general KLibFactory feature though?


Regarding your original problem, I think what you need is this:

libfoo
plugin_foo linking to libfoo
kcm_foo linking to libfoo

libfoo contains the static public methods and properties. If both the plugin 
and the kcm are loaded they're linking to the same library and share the 
global data as long as the symbols are really in the lib and not only defined 
in the header.

-- 
________________________________________________________
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/20070810/ee491798/attachment.sig>


More information about the kde-core-devel mailing list