[PATCH] kcmoduleinfo [WAS] Plugin linking problem
Rafael Fernández López
ereslibre at gmail.com
Tue Aug 7 01:43:03 BST 2007
Hi again !
Facing the problem on the message with the previous topic, the best
solution I could find is the one I have done.
Problem was that I wanted a unique library to provide a plugin and its
configuration dialog (which is a KCModule). KCModules NEED their
library to start with "kcm_". So, I was going to ship a plugin and its
configuration dialog on a library starting by "kcm_", no way...
So the ideal solution is slightly different: ship the plugin and its
configuration dialog itself in a library called as you want. Yeah,
then the configuration dialog wouldn't come up because of the lack of
"kcm_". Okay, then I have dived into the problem till I got to
KCModuleInfo.
So, my rationale for this change on kdelibs/kutils/kcmoduleinfo.cpp is the next:
Why force a KCModule to be shipped on a library starting by "kcm_" ?
For me, it makes not so much sense. The only think you need to have in
mind is to put on X-KDE-Library variable the name of the library that
you are giving on CMakeLists.txt. Nothing more.
So my proposed change is:
Index: kutils/kcmoduleinfo.cpp
============================================
--- kutils/kcmoduleinfo.cpp (revisión: 697136)
+++ kutils/kcmoduleinfo.cpp (copia de trabajo)
@@ -71,8 +71,6 @@
icon = service->icon();
fileName = service->desktopEntryPath();
lib = service->library();
- if( !lib.startsWith( QLatin1String( "kcm_" ) ) )
- lib = QLatin1String( "kcm_" ) + lib;
keywords = service->keywords();
}
Now the problem is solved in a very clean way. The same library, say
"ktexteditor_docwordcompletion" will ship the plugin and the config
module itself for letting KPluginSelector load it.
Please, note that I've copied manually the patch and it may contain
spelling errors. Just for you to get the idea, if you try to apply it
directly, don't blame me if it fails !! :)
So that's all, I would like to know if this is OK to commit.
Of course, there is work related that should be done, a grep on all
.desktop files looking for "ServiceTypes=KCModule" and adding the
"kcm_" before the library name if there isn't.
Bye and thanks,
Rafael Fernández López.
More information about the kde-core-devel
mailing list