Why is KPluginInfo (const KService::Ptr service) deprecated?

Martin Gräßlin mgraesslin at kde.org
Mon Mar 17 08:55:12 UTC 2014


Hi all,

I just went through the deprecated warnings in KWin and run over a lot of 
warnings like:

‘KPluginInfo::KPluginInfo(KService::Ptr)’ is deprecated (declared at 
/opt/kf5/include/KF5/KService/kplugininfo.h:114) [-Wdeprecated-declarations]

and

‘static KPluginInfo::List KPluginInfo::fromServices(const List&, const 
KConfigGroup&)’ is deprecated (declared at 
/opt/kf5/include/KF5/KService/kplugininfo.h:181) [-Wdeprecated-declarations]

The documentation tells me that I should use KPluginLoader instead and use 
build the plugin with json meta data. But all the services I generate the 
plugin info for are not binary or only may be binary. Example usage from KWin 
is populating a KPluginSelector with all KWin scripts, which are obviously not 
binary plugins I could compile metadata into.

E.g.:
KService::List offers = KServiceTypeTrader::self()->query("KWin/Script", 
"...");
QList<KPluginInfo> scriptinfos = KPluginInfo::fromServices(offers);
ui->scriptSelector->addPlugins(scriptinfos, KPluginSelector::ReadConfigFile, 
QString(), QString(), m_kwinConfig);

So what's the supposed way to port these use cases or is the deprecation wrong 
as it was not considered that plugins may not be binary at all?

Cheers
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140317/a2597515/attachment.sig>


More information about the Kde-frameworks-devel mailing list