diff options
author | Richard Hughes <richard@hughsie.com> | 2016-09-05 09:14:46 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-01-17 10:36:19 +0000 |
commit | 7f0393346de6154a20ae1713ccbe58535ed649f7 (patch) | |
tree | 20fe48d754f59a1bbe6233a7b5e72da4477b55d7 | |
parent | 7e7c373360f259db2584dc68c1a94027aacb4e07 (diff) | |
download | appstream-glib-7f0393346de6154a20ae1713ccbe58535ed649f7.tar.gz |
trivial: Do not write <icon type=unknown> for unknown types
-rw-r--r-- | libappstream-glib/as-icon.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libappstream-glib/as-icon.c b/libappstream-glib/as-icon.c index bceaf78..a672236 100644 --- a/libappstream-glib/as-icon.c +++ b/libappstream-glib/as-icon.c @@ -530,9 +530,11 @@ as_icon_node_insert (AsIcon *icon, GNode *parent, AsNodeContext *ctx) } break; default: - n = as_node_insert (parent, "icon", priv->name, 0, - "type", as_icon_kind_to_string (priv->kind), - NULL); + n = as_node_insert (parent, "icon", priv->name, 0, NULL); + if (priv->kind != AS_ICON_KIND_UNKNOWN) { + as_node_add_attribute (n, "type", + as_icon_kind_to_string (priv->kind)); + } break; } if (priv->kind == AS_ICON_KIND_CACHED && |