1DESKTOPTOJSON(8) KDE Frameworks: KService DESKTOPTOJSON(8)
2
3
4
6 desktoptojson - Converts a .desktop file to a .json file.
7
9 desktoptojson --input DESKTOP-FILE --output JSON-FILE
10
11 desktoptojson {--version | --help}
12
14 The KService framework uses information contained in .desktop files to
15 locate services, including plugins for Qt5-based applications and
16 libraries. The Qt5 plugin system, however, uses JSON data embedded in
17 the plugin itself. desktoptojson allows the information contained in a
18 .desktop file to also be used as the embedded data for a Qt5 plugin by
19 converting the .desktop file entries into JSON data.
20
21 The generated JSON data is a JSON object that maps the entries from the
22 [Desktop Entry] group of the .desktop file. Any other groups are
23 ignored. Most entries are just converted to JSON strings, but certain
24 entries (such as Hidden and X-KDE-PluginInfo-EnabledByDefault) are
25 known to be boolean values and converted as such, and similarly some
26 (such as X-KDE-ServiceTypes and X-KDE-PluginInfo-Depends) are always
27 converted to arrays of strings.
28
30 --input DESKTOP-FILE
31 The .desktop file to convert.
32
33 --output JSON-FILE
34 The file to write the generated JSON data to.
35
36 --help
37 Show a brief help text.
38
39 --version
40 Show version information.
41
43 Most users of this utility will use the CMake macro
44 kservice_desktop_to_json as part of the process of building a plugin.
45
46
47 add_library(myplugin MODULE ${myplugin_SRCS})
48 kservice_desktop_to_json(myplugin myplugin.desktop)
49
50
51 This will produce the JSON file myplugin.json, which can be referenced
52 from the K_PLUGIN_FACTORY_WITH_JSON or Q_PLUGIN_METADATA macros.
53
55 Please use KDE's bugtracker[1] to report bugs.
56
58 Scarlett Clark <scarlett@scarlettgatelyclark.com>
59 Wrote the original documentation.
60
61 Alex Merry <alexmerry@kde.org>
62 Edited the documentation.
63
65 1. KDE's bugtracker
66 https://bugs.kde.org
67
68
69
70KDE Frameworks Frameworks 5.0 2014-04-02 DESKTOPTOJSON(8)