diff options
author | Richard Hughes <richard@hughsie.com> | 2014-07-11 21:01:38 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-07-11 21:01:38 +0100 |
commit | a108507d0c5f291617c10170ca275cd8c1047e6d (patch) | |
tree | fd50b46bc65e70cd3b9498f10107be7c30d66062 | |
parent | 7670d8eede5136262d5c19ba2eade8e23bd560a9 (diff) | |
download | appstream-glib-a108507d0c5f291617c10170ca275cd8c1047e6d.tar.gz |
Record if distro metadata and screenshots are being used
-rw-r--r-- | client/as-util.c | 11 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-appdata.c | 1 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-hardcoded.c | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/client/as-util.c b/client/as-util.c index 10db58d..cccb8c1 100644 --- a/client/as-util.c +++ b/client/as-util.c @@ -1087,6 +1087,9 @@ as_util_status_html_write_app (AsApp *app, GString *html) gchar *tmp; guint i; guint j; + const gchar *important_md[] = { "DistroMetadata", + "DistroScreenshots", + NULL }; g_string_append_printf (html, "<a name=\"%s\"/><h2>%s</h2>\n", as_app_get_id (app), as_app_get_id (app)); @@ -1188,6 +1191,14 @@ as_util_status_html_write_app (AsApp *app, GString *html) } g_free (tmp); + /* certain metadata keys */ + for (i = 0; important_md[i] != NULL; i++) { + if (as_app_get_metadata_item (app, important_md[i]) == NULL) + continue; + g_string_append_printf (html, "<tr><td class=\"alt\">%s</td><td>%s</td></tr>\n", + important_md[i], "Yes"); + } + /* kudos */ if (as_app_get_id_kind (app) == AS_ID_KIND_DESKTOP) { tmp = as_util_status_html_join (as_app_get_kudos (app)); diff --git a/libappstream-builder/plugins/asb-plugin-appdata.c b/libappstream-builder/plugins/asb-plugin-appdata.c index 6ffaf76..573ab47 100644 --- a/libappstream-builder/plugins/asb-plugin-appdata.c +++ b/libappstream-builder/plugins/asb-plugin-appdata.c @@ -508,6 +508,7 @@ asb_plugin_process_app (AsbPlugin *plugin, /* any appdata-extra file */ if (appdata_filename_extra != NULL && g_file_test (appdata_filename_extra, G_FILE_TEST_EXISTS)) { + as_app_add_metadata (AS_APP (app), "DistroMetadata", NULL, -1); return asb_plugin_process_filename (plugin, app, appdata_filename_extra, diff --git a/libappstream-builder/plugins/asb-plugin-hardcoded.c b/libappstream-builder/plugins/asb-plugin-hardcoded.c index 5834ece..a970038 100644 --- a/libappstream-builder/plugins/asb-plugin-hardcoded.c +++ b/libappstream-builder/plugins/asb-plugin-hardcoded.c @@ -131,6 +131,7 @@ asb_plugin_hardcoded_add_screenshots (AsbApp *app, if (!ret) goto out; } + as_app_add_metadata (AS_APP (app), "DistroScreenshots", NULL, -1); out: g_list_free_full (list, g_free); return ret; |