From cdc7adb2a3696c41d01c715542cb82b984e2631e Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 12 Jul 2017 10:46:10 +0200 Subject: democompositor: Describe applications using a JSON file Inspired by the freedesktop.org specification define a simple JSON format and add files for the existing demo applications using this specifcation. Install them into the QStandardPaths::DataLocation/apps direcyory. Change-Id: If5bbec8ec3a1b375f1e58f8534545b89507cc1a8 Reviewed-by: Paul Olav Tvete --- wayland/democompositor/apps/README | 20 ++++++++++++++++++++ wayland/democompositor/apps/files/clock.app | 8 ++++++++ wayland/democompositor/apps/files/maps.app | 8 ++++++++ wayland/democompositor/apps/files/rss.app | 8 ++++++++ wayland/democompositor/apps/files/stocqt.app | 8 ++++++++ wayland/democompositor/democompositor.pro | 6 +++++- 6 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 wayland/democompositor/apps/README create mode 100644 wayland/democompositor/apps/files/clock.app create mode 100644 wayland/democompositor/apps/files/maps.app create mode 100644 wayland/democompositor/apps/files/rss.app create mode 100644 wayland/democompositor/apps/files/stocqt.app (limited to 'wayland') diff --git a/wayland/democompositor/apps/README b/wayland/democompositor/apps/README new file mode 100644 index 0000000..361b2c1 --- /dev/null +++ b/wayland/democompositor/apps/README @@ -0,0 +1,20 @@ +A directory holding a list of applications. There is one JSON file +per launchable application. The content is inspired by the "Desktop +Entry Specification" of freedesktop.org. + +Application files need to be installed into any of the paths that +will be listed for QStandardPaths::DataLocation/apps. In the +case of the democompositor this can be +/usr/share/democompositor/apps. + +The content of the files must follow: + +Name Description Required JSON type +Type Type of entry. Currently only Yes String + Application is supported. +Version The version of the specification + addressed. Currently version 1 Yes Number +Icon The icon to use for display Yes String +Name A user displayable name Yes String +Exec Application to execute to launch Yes String +Path The directory to search for the app No String diff --git a/wayland/democompositor/apps/files/clock.app b/wayland/democompositor/apps/files/clock.app new file mode 100644 index 0000000..d6f5f56 --- /dev/null +++ b/wayland/democompositor/apps/files/clock.app @@ -0,0 +1,8 @@ +{ + "Type": "Application", + "Version": 1, + "Icon": "qrc:/images/Icon_Clocks.png", + "Name": "Clocks", + "Exec": "clocks", + "Path": "./" +} diff --git a/wayland/democompositor/apps/files/maps.app b/wayland/democompositor/apps/files/maps.app new file mode 100644 index 0000000..e88899a --- /dev/null +++ b/wayland/democompositor/apps/files/maps.app @@ -0,0 +1,8 @@ +{ + "Type": "Application", + "Version": 1, + "Icon": "qrc:/images/Icon_Maps.png", + "Name": "Maps", + "Exec": "qml_location_mapviewer", + "Path": "./" +} diff --git a/wayland/democompositor/apps/files/rss.app b/wayland/democompositor/apps/files/rss.app new file mode 100644 index 0000000..13ffbca --- /dev/null +++ b/wayland/democompositor/apps/files/rss.app @@ -0,0 +1,8 @@ +{ + "Type": "Application", + "Version": 1, + "Icon": "qrc:/images/Icon_RSS.png", + "Name": "RSS News", + "Exec": "rssnews", + "Path": "./" +} diff --git a/wayland/democompositor/apps/files/stocqt.app b/wayland/democompositor/apps/files/stocqt.app new file mode 100644 index 0000000..9317359 --- /dev/null +++ b/wayland/democompositor/apps/files/stocqt.app @@ -0,0 +1,8 @@ +{ + "Type": "Application", + "Version": 1, + "Icon": "qrc:/images/Icon_StocQt.png", + "Name": "StoQt", + "Exec": "stocqt", + "Path": "./" +} diff --git a/wayland/democompositor/democompositor.pro b/wayland/democompositor/democompositor.pro index 99b6f93..cbed99f 100644 --- a/wayland/democompositor/democompositor.pro +++ b/wayland/democompositor/democompositor.pro @@ -17,5 +17,9 @@ RESOURCES += democompositor.qrc HEADERS += \ processlauncher.h -INSTALLS += target +INSTALLS += target apps target.path = /data/user/$$TARGET + +# TODO. How does /data/user/$$TARGET map to QStandardPaths +apps.path = /data/user/$$TARGET/apps/ +apps.files = apps/files/*.app -- cgit v1.2.3