Review Request 120198: KPluginInfo: use KPluginMetaData instead of a QVariantMap for storage

Alexander Richardson arichardson.kde at gmail.com
Tue Sep 23 08:01:55 UTC 2014



> On Sept. 22, 2014, 11:08 nachm., David Faure wrote:
> > We already have old JSON and new JSON? Now I am indeed completely lost with this stuff. Seems application developers are, too, given the questions I got during Akademy. We (= the set of people who understand this stuff) need to write some porting documentation about this, in https://community.kde.org/Frameworks/Porting_Notes ...

When introducing KPluginMetaData it was suggested to use a new format instead of simply transforming the desktop files 1-to-1 to JSON, which is what I then did.

`kcoreaddons_desktop_to_json()` generates the new format and `kservice_desktop_to_json()` still creates that 1-to-1 mapping with X-KDE-PluginInfo key names so that applications that relied on the JSON having exactly those key names don't break.
However since this patch makes sure calling KPluginInfo::property() with those old key names still works we can deprecate `kservice_desktop_to_json()` and use `kcoreaddons_desktop_to_json()` instead everywhere.
As long as the translations can't be done directly in the .json files we have to rely on converting .desktop files anyway and that means we shouldn't need to care about the actual JSON format until that is possible.

I'll add some more content to the porting notes later today.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120198/#review67234
-----------------------------------------------------------


On Sept. 14, 2014, 4:05 nachm., Alexander Richardson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120198/
> -----------------------------------------------------------
> 
> (Updated Sept. 14, 2014, 4:05 nachm.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kservice
> 
> 
> Description
> -------
> 
> A series of 4 commits:
> 
> ----
> 
> KPluginInfo: use KPluginMetaData instead of a QVariantMap for storage
> 
> This means that KPluginInfo can now simply reuse the QJsonObject
> returned by QPluginLoader.metaData() (by storing it in a 
> KPluginMetaData object instead of having to convert the JSON to a
> QVariantMap first.
> 
> Additionally this allows very efficient conversion between KPluginInfo
> and KPluginMetaData.
> 
> ---
> Add compatibility key names to KPluginInfo::property()
> 
> ---
> 
> KPluginInfo: Fix loading JSON metadata that only has compatibility keys
> 
> This can be removed in KF6, but for now allows loading all both old
> style as well as new style metadata
> 
> ----
> 
> kplugininfotest: also test objects constructed from JSON
> 
> This tests both new style JSON as well as JSON using the old key names
> 
> 
> Diffs
> -----
> 
>   autotests/CMakeLists.txt 913e848ba5d1754ef7726f92604d1aaa398fa107 
>   autotests/kplugininfotest.cpp 34f87028ce08f2db1e5f57edbc6f99a237bf90ac 
>   src/services/kplugininfo.h dea07e6e63baf2483afc4a6d43d0892efc485903 
>   src/services/kplugininfo.cpp 50a6564edbbb1890c0b91badad69db967035231f 
> 
> Diff: https://git.reviewboard.kde.org/r/120198/diff/
> 
> 
> Testing
> -------
> 
> All unit tests still work
> 
> 
> Thanks,
> 
> Alexander Richardson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140923/b1ad1145/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list