plugin loading (was: kcmoduleinfo / Plugin linking problem)
Matthias Kretz
kretz at kde.org
Sun Aug 12 15:47:59 BST 2007
Oh, I forgot to mention that using this interface it's also possible to
implement a generic factory for scripting languages:
On Sunday 12 August 2007, Matthias Kretz wrote:
> virtual QObject *createObject(const char *iface, QObject *parent,
> const QVariantList &args, const QString &keyword) {
> SubFactory *subFactory =
> m_createInstanceHash[iface].value(keyword); if (subFactory) {
> return subFactory->createInstance(parent, args);
> }
> return 0;
> }
As createObject is virtual you don't have to use K_REGISTER_PLUGIN in your
factory but can also reimplement createObject. With this you could e.g. write
one generic kde_python_plugin.so which could be used for any kind of plugin
interface (so the KCModuleFactory is unnecessary then). Using the iface and
keyword strings there's enough data to identify the python code to load and
execute it.
--
________________________________________________________
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/3eb8029c/attachment.sig>
More information about the kde-core-devel
mailing list