Silence kcoreaddons_desktop_to_json warnings
ClosedPublic

Authored by elvisangelaccio on Mar 17 2016, 2:43 PM.

Details

Summary

Since cmake 3.5, I get the following warning every time kcoreaddons_desktop_to_json is called:

"Calling kcoreaddons_desktop_to_json() without DEFAULT_SERVICE_TYPE or SERVICE_TYPES is
deprecated!"

The documentation of kcoreaddons_desktop_to_json recommends that the macro be
used with either DEFAULT_SERVICE_TYPE or SERVICE_TYPES set.

From what I read in [1], DEFAULT_SERVICE_TYPE is used if the macro is called
without neither of the arguments above. So adding DEFAULT_SERVICE_TYPE looks
like the right way to silence the warning.

[1]: https://git.reviewboard.kde.org/r/125262/

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
elvisangelaccio retitled this revision from to Silence kcoreaddons_desktop_to_json warnings.
elvisangelaccio added a reviewer: arichardson.
elvisangelaccio updated this object.
Restricted Application added a project: Ark. · View Herald TranscriptMar 17 2016, 2:43 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald Transcript
arichardson accepted this revision.Mar 22 2016, 2:26 PM
arichardson edited edge metadata.
arichardson added inline comments.
plugins/cli7zplugin/CMakeLists.txt
23

Seems to me like the correct fix is SERVICE_TYPES ${CMAKE_SOURCE_DIR}/kerfuffle/kerfufflePlugin.desktop

This revision is now accepted and ready to land.Mar 22 2016, 2:26 PM
This revision was automatically updated to reflect the committed changes.
plugins/cli7zplugin/CMakeLists.txt
23

As discussed on IRC, this would have changed the generated JSON files. For instance X-KDE-Kerfuffle-EncryptHeader would become a JSON array, while in the current codebase we assume that it is a single string variable.

For now we just silence the warnings (setting the DEFAULT_SERVICE_TYPE option), in the future we'll get rid of all .desktop files and replace them with json ones.