summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-icon.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-10-09 13:30:22 +0100
committerRichard Hughes <richard@hughsie.com>2017-10-09 13:30:24 +0100
commita1481d201d089f9e70a0cf48a0424315e0f6cdaf (patch)
treeb27c17cdd21d0e292715106fe6e77f25124a7033 /libappstream-glib/as-icon.c
parentf5fb6e40f5aeba2cde1de0406815af876d41be3a (diff)
downloadappstream-glib-a1481d201d089f9e70a0cf48a0424315e0f6cdaf.tar.gz
Write XML for newer AppStream specification versions
Any XML parser should ignore the extra tags or attributes, and so it serves no purpose to artificailly hide these when building metadata for older versions of the specification. This also fixes a bug on i386 where 0.6 != 0.6 and I didn't want to use fabs() all over the place for basically no reason.
Diffstat (limited to 'libappstream-glib/as-icon.c')
-rw-r--r--libappstream-glib/as-icon.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libappstream-glib/as-icon.c b/libappstream-glib/as-icon.c
index 9fc3ba7..8a13ae0 100644
--- a/libappstream-glib/as-icon.c
+++ b/libappstream-glib/as-icon.c
@@ -513,11 +513,9 @@ as_icon_node_insert_embedded (AsIcon *icon, GNode *parent, AsNodeContext *ctx)
n = as_node_insert (parent, "icon", NULL, 0,
"type", as_icon_kind_to_string (priv->kind),
NULL);
- if (as_node_context_get_version (ctx) >= 0.8) {
- as_node_add_attribute_as_uint (n, "width", priv->width);
- as_node_add_attribute_as_uint (n, "height", priv->height);
- }
- if (priv->scale > 1 && as_node_context_get_version (ctx) > 0.9)
+ as_node_add_attribute_as_uint (n, "width", priv->width);
+ as_node_add_attribute_as_uint (n, "height", priv->height);
+ if (priv->scale > 1)
as_node_add_attribute_as_uint (n, "scale", priv->scale);
as_node_insert (n, "name", priv->name, 0, NULL);
data = g_base64_encode (g_bytes_get_data (priv->data, NULL),
@@ -575,8 +573,7 @@ as_icon_node_insert (AsIcon *icon, GNode *parent, AsNodeContext *ctx)
}
break;
}
- if (priv->kind == AS_ICON_KIND_CACHED &&
- as_node_context_get_version (ctx) >= 0.8) {
+ if (priv->kind == AS_ICON_KIND_CACHED) {
if (priv->width > 0)
as_node_add_attribute_as_uint (n, "width", priv->width);
if (priv->height > 0)