]> &kde-frameworks;: KService Scarlett Clark Wrote the original documentation.
scarlett@scarlettgatelyclark.com
Alex Merry Edited the documentation.
alexmerry@kde.org
2014-04-02 Frameworks 5.0 KDE Frameworks
desktoptojson 8 desktoptojson Converts a .desktop file to a .json file. Synopsis desktoptojson --input DESKTOP-FILE --output JSON-FILE desktoptojson --version --help Description The KService framework uses information contained in .desktop files to locate services, including plugins for Qt5-based applications and libraries. The Qt5 plugin system, however, uses &JSON; data embedded in the plugin itself. desktoptojson allows the information contained in a .desktop file to also be used as the embedded data for a Qt5 plugin by converting the .desktop file entries into &JSON; data. The generated &JSON; data is a &JSON; object that maps the entries from the [Desktop Entry] group of the .desktop file. Any other groups are ignored. Most entries are just converted to &JSON; strings, but certain entries (such as Hidden and X-KDE-PluginInfo-EnabledByDefault) are known to be boolean values and converted as such, and similarly some (such as X-KDE-ServiceTypes and X-KDE-PluginInfo-Depends) are always converted to arrays of strings. Options The .desktop file to convert. The file to write the generated &JSON; data to. Show a brief help text. Show version information. Usage Most users of this utility will use the &cmake; macro kservice_desktop_to_json as part of the process of building a plugin. This will produce the &JSON; file myplugin.json, which can be referenced from the K_PLUGIN_FACTORY_WITH_JSON or Q_PLUGIN_METADATA macros. Bugs Please use &kde;'s bugtracker to report bugs.