diff options
-rw-r--r-- | libappstream-glib/as-app.c | 8 | ||||
-rw-r--r-- | libappstream-glib/as-tag.c | 1 | ||||
-rw-r--r-- | libappstream-glib/as-tag.gperf | 1 | ||||
-rw-r--r-- | libappstream-glib/as-tag.h | 2 |
4 files changed, 9 insertions, 3 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index 1d6fbe5..0017c7d 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -4315,9 +4315,10 @@ as_app_node_insert (AsApp *app, GNode *parent, AsNodeContext *ctx) } } - /* <metadata> */ + /* <custom> or <metadata> */ if (g_hash_table_size (priv->metadata) > 0) { - node_tmp = as_node_insert (node_app, "metadata", NULL, 0, NULL); + tmp = as_node_context_get_version (ctx) > 0.9 ? "custom" : "metadata"; + node_tmp = as_node_insert (node_app, tmp, NULL, 0, NULL); as_node_insert_hash (node_tmp, "value", "key", priv->metadata, FALSE); } @@ -4785,8 +4786,9 @@ as_app_node_parse_child (AsApp *app, GNode *n, AsAppParseFlags flags, priv->problems |= AS_APP_PROBLEM_EXPECTED_CHILDREN; break; - /* <metadata> */ + /* <custom> or <metadata> */ case AS_TAG_METADATA: + case AS_TAG_CUSTOM: if (!(flags & AS_APP_PARSE_FLAG_APPEND_DATA)) g_hash_table_remove_all (priv->metadata); for (c = n->children; c != NULL; c = c->next) { diff --git a/libappstream-glib/as-tag.c b/libappstream-glib/as-tag.c index 021425c..9e84381 100644 --- a/libappstream-glib/as-tag.c +++ b/libappstream-glib/as-tag.c @@ -201,6 +201,7 @@ as_tag_to_string (AsTag tag) "reviewer_id", "suggests", "requires", + "custom", NULL }; if (tag > AS_TAG_LAST) tag = AS_TAG_LAST; diff --git a/libappstream-glib/as-tag.gperf b/libappstream-glib/as-tag.gperf index 1b5eb79..f002ee0 100644 --- a/libappstream-glib/as-tag.gperf +++ b/libappstream-glib/as-tag.gperf @@ -65,3 +65,4 @@ reviewer_name, AS_TAG_REVIEWER_NAME reviewer_id, AS_TAG_REVIEWER_ID suggests, AS_TAG_SUGGESTS requires, AS_TAG_REQUIRES +custom, AS_TAG_CUSTOM diff --git a/libappstream-glib/as-tag.h b/libappstream-glib/as-tag.h index 66a4ad1..2fa91e6 100644 --- a/libappstream-glib/as-tag.h +++ b/libappstream-glib/as-tag.h @@ -90,6 +90,7 @@ G_BEGIN_DECLS * @AS_TAG_REVIEWER_ID: `reviewer_id` * @AS_TAG_SUGGESTS: `suggests` * @AS_TAG_REQUIRES: `requires` + * @AS_TAG_CUSTOM: `custom` * * The tag type. **/ @@ -152,6 +153,7 @@ typedef enum { AS_TAG_REVIEWER_ID, /* Since: 0.6.1 */ AS_TAG_SUGGESTS, /* Since: 0.6.1 */ AS_TAG_REQUIRES, /* Since: 0.6.7 */ + AS_TAG_CUSTOM, /* Since: 0.6.8 */ /*< private >*/ AS_TAG_LAST } AsTag; |