plugin loading (was: kcmoduleinfo / Plugin linking problem)

Matthias Kretz kretz at kde.org
Sun Aug 12 11:44:42 BST 2007


Hi,

attached you'll find some code examples of the current way our KDE plugin code 
works (please correct me if I'm wrong there) and some code how I think it 
could look. There's no way to support one export macro per plugin class if we 
want to use Q_EXPORT_PLUGIN2 so my suggestion uses one factory class per DSO

The K_PLUGIN_FACTORY{,_DEFINITION,_DECLARATION} macros are simple enough that 
we might not want to provide them - but that's a detail.

If you wonder how one can implement the factory take a look at main.cpp 
(run "qmake -project; qmake; make" to compile it)

While going over it I found one thing which I think we should change in any 
case: the "const QStringList &args" parameter should be a "const QVariantList 
&args" instead.

-- 
________________________________________________________
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: pluginloading.cpp
Type: text/x-c++src
Size: 5187 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070812/343b458e/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 4489 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070812/343b458e/attachment-0001.cpp>
-------------- 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/343b458e/attachment.sig>


More information about the kde-core-devel mailing list