diff options
author | Richard Hughes <richard@hughsie.com> | 2018-05-18 15:16:50 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2018-05-21 17:16:29 +0100 |
commit | 711b1e104a5dbfc349c06584a4f721c75786d5c6 (patch) | |
tree | b237d19a2609b50dd166ffab4939c2af9877d639 | |
parent | b5ab36a74aec00c2fe41cfc0db804fe1465513a9 (diff) | |
download | appstream-glib-711b1e104a5dbfc349c06584a4f721c75786d5c6.tar.gz |
trivial: Do not duplicate each <category> or <project_group> tag
-rw-r--r-- | libappstream-glib/as-app.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index 3707b55..553940a 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -5034,10 +5034,10 @@ as_app_node_parse_child (AsApp *app, GNode *n, guint32 flags, for (c = n->children; c != NULL; c = c->next) { if (as_node_get_tag (c) != AS_TAG_CATEGORY) continue; - tmp = as_node_get_data_as_refstr (c); - if (tmp == NULL) + str = as_node_get_data_as_refstr (c); + if (str == NULL) continue; - as_app_add_category (app, tmp); + g_ptr_array_add (priv->categories, as_ref_string_ref (str)); } if (n->children == NULL) priv->problems |= AS_APP_PROBLEM_EXPECTED_CHILDREN; @@ -5193,7 +5193,8 @@ as_app_node_parse_child (AsApp *app, GNode *n, guint32 flags, priv->problems |= AS_APP_PROBLEM_TRANSLATED_PROJECT_GROUP; break; } - as_app_set_project_group (app, as_node_get_data (n)); + as_ref_string_assign (&priv->project_group, + as_node_get_data_as_refstr (n)); break; /* <compulsory_for_desktop> */ |