diff options
author | Richard Hughes <richard@hughsie.com> | 2014-07-29 17:30:06 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-07-29 17:30:06 +0100 |
commit | 6c9c5a8c67c309cae758288631b02663fccf91ca (patch) | |
tree | 3927970a1a99284f2526999ea44ef7f44c5b78e9 /libappstream-glib/as-provide.c | |
parent | 6c9d59b44d819a9bcc0527619b6ef37da32a260d (diff) | |
download | appstream-glib-6c9c5a8c67c309cae758288631b02663fccf91ca.tar.gz |
DBus system services do not have <dbus-system> as the tag name
Diffstat (limited to 'libappstream-glib/as-provide.c')
-rw-r--r-- | libappstream-glib/as-provide.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libappstream-glib/as-provide.c b/libappstream-glib/as-provide.c index c509b2d..f9d980d 100644 --- a/libappstream-glib/as-provide.c +++ b/libappstream-glib/as-provide.c @@ -235,18 +235,26 @@ as_provide_node_insert (AsProvide *provide, GNode *parent, gdouble api_version) AsProvidePrivate *priv = GET_PRIVATE (provide); GNode *n; - n = as_node_insert (parent, as_provide_kind_to_string (priv->kind), - priv->value, - AS_NODE_INSERT_FLAG_NONE, - NULL); switch (priv->kind) { case AS_PROVIDE_KIND_DBUS: - as_node_add_attribute (n, "type", "session", -1); + n = as_node_insert (parent, "dbus", + priv->value, + AS_NODE_INSERT_FLAG_NONE, + "type", "session", + NULL); break; case AS_PROVIDE_KIND_DBUS_SYSTEM: - as_node_add_attribute (n, "type", "system", -1); + n = as_node_insert (parent, "dbus", + priv->value, + AS_NODE_INSERT_FLAG_NONE, + "type", "system", + NULL); break; default: + n = as_node_insert (parent, as_provide_kind_to_string (priv->kind), + priv->value, + AS_NODE_INSERT_FLAG_NONE, + NULL); break; } return n; @@ -269,6 +277,9 @@ as_provide_node_parse (AsProvide *provide, GNode *node, GError **error) { AsProvidePrivate *priv = GET_PRIVATE (provide); priv->kind = as_provide_kind_from_string (as_node_get_name (node)); + if (priv->kind == AS_PROVIDE_KIND_DBUS && + g_strcmp0 (as_node_get_attribute (node, "type"), "system") == 0) + priv->kind = AS_PROVIDE_KIND_DBUS_SYSTEM; g_free (priv->value); priv->value = as_node_take_data (node); return TRUE; |