[PATCH] kcmoduleinfo [WAS] Plugin linking problem

Rafael Fernández López ereslibre at gmail.com
Wed Aug 8 02:23:22 BST 2007


Hi all,

Here are the patches for revision. I will commit on monday this change
if everybody agree.

The main reason for this change is to allow a library with a free name
contain a KCModule. With KCModuleInfo class restrictions, it forced
the library containing the KCModule to start by "kcm_".

In the KPluginSelector solution, KCModules are needed. While porting a
plugin on Kate for the KPluginSelector configuration system, I wanted
the same library (ktexteditor_docwordcompletion) to provide both, the
plugin and the configuration dialog. Of course, it made no sense
calling it "kcm_ktexteditor_docwordcompletion", since the most
important part of the library is the plugin, not the configuration
dialog for the plugin.

This had side-effects problems. I explain them. The code removed from
KCModuleInfo is something like:

if (!libraryName.startsWith("kcm_"))
    libraryName = "kcm_" + libraryName;

So, on many ".desktop" files for KCModules we could found
X-KDE-Library=foo, instead of X-KDE-Library=kcm_foo. Yeah, it was
going to be added by that part of code. So, when removing that part of
code, I have taken in count all .desktop files affected by the change,
and adapted them to it (adding "kcm_" where needed).

This had an impact on the code of some KCModules too. The reason for
this is that if on .desktop file no X-KDE-FactoryName is provided, the
X-KDE-Library is taken as X-KDE-FactoryName. Result ? Yeah, on those
.desktop files with X-KDE-Library not starting by "kcm_" and without
X-KDE-FactoryName, I had to do some changes on the code of the
modules, always something like:

K_EXPORT_COMPONENT_FACTORY(foo, ...)

to

K_EXPORT_COMPONENT_FACTORY(kcm_foo, ...)

So those are the explanations for the changes done. Here are the patches:

http://media.ereslibre.es/2007/08/kdelibs-08082007.diff
http://media.ereslibre.es/2007/08/kdepimlibs-08082007.diff
http://media.ereslibre.es/2007/08/kdebase-08082007.diff

I am not attaching them because of the size.


Bye,
Rafael Fernández López.


More information about the kde-core-devel mailing list