DataEngine & KPluginFactory

Sebastian Kügler sebas at kde.org
Mon Jun 24 10:48:55 UTC 2013


Hey,

As you know, I'm looking into what's needed for proper plugin support in KF5, 
trying to understand what's going on, and at least making our KDE4 solution 
work for KF5. Qt's native plugin functionality is clearly lacking for our 
usecase, as it doesn't allow to have multiple instances of the same plugin 
type. (Say, it is possible to write a new QPA plugin, but you can't have a few 
dataengines loaded as plugins.)

So KPluginLoader seems to still work fine, but spits out a warning that the 
K_EXPORT_ macro should be ported to the new QPluing (Q_PLUGIN_METADATA) stuff 
-- which isn't suitable for our case. David suggested to pop Q_PLUGIN_METADATA 
into the K_EXPORT_ macro definition, but that apparently doesn't help. (Steven 
writes why in http://www.kdab.com/porting-from-qt-4-to-qt-5 , "Plugin 
loading".) Ignoring our home-made deprecation warning, it seems KPlugin* is 
still working.

So, on to the dataengine. There, we've changed the ctor from taking a 
(QObject*, QVariantMap) to (KPluginInfo, QObject*). The problem here is that 
this won't build, I suppose because the K_EXPORT_ macro expects (QObject*, 
QVariantMap), and indeed, adding such a ctor makes my timeengine load -- with 
the wrong ctor, and obviously missing the KPluginInfo member. So, what do to 
here:

- Add previous ctor, but where to get the KPluginInfo from, or rather, how to 
  get it into our class instance (we already retrieve it from KService)?

- How can we make it work with the (KPluginInfo, QObject*) signature?

- Other idea?

I'm still quite puzzled about this whole situation, but I think I'm slowly 
making some progress. :)

Cheers,
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Kde-frameworks-devel mailing list