summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-06-06 11:02:07 +0100
committerRichard Hughes <richard@hughsie.com>2014-06-06 11:02:25 +0100
commit4f6e1230f7f3d7df873d85d5be5c1a404c3787e5 (patch)
tree9e2068734b4d362cdfb19ab16da4162a8febb32c
parentc7421b696dd3fa56aa9c5ce85e5c3eb3991c59d3 (diff)
downloadappstream-glib-4f6e1230f7f3d7df873d85d5be5c1a404c3787e5.tar.gz
Do not write a screenshot type of 'normal' as it's the default value
-rw-r--r--libappstream-glib/as-screenshot.c7
-rw-r--r--libappstream-glib/as-self-test.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/libappstream-glib/as-screenshot.c b/libappstream-glib/as-screenshot.c
index 87547cf..454c241 100644
--- a/libappstream-glib/as-screenshot.c
+++ b/libappstream-glib/as-screenshot.c
@@ -288,8 +288,13 @@ as_screenshot_node_insert (AsScreenshot *screenshot,
n = as_node_insert (parent, "screenshot", NULL,
AS_NODE_INSERT_FLAG_NONE,
- "type", as_screenshot_kind_to_string (priv->kind),
NULL);
+ if (priv->kind != AS_SCREENSHOT_KIND_NORMAL) {
+ as_node_add_attribute (n,
+ "type",
+ as_screenshot_kind_to_string (priv->kind),
+ -1);
+ }
if (api_version >= 0.41) {
as_node_insert_localized (n,
"caption",
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index 9859646..90c3a12 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -271,7 +271,7 @@ ch_test_screenshot_func (void)
GNode *root;
GString *xml;
const gchar *src =
- "<screenshot type=\"normal\">"
+ "<screenshot>"
"<caption>Hello</caption>"
"<image type=\"source\">http://1.png</image>"
"<image type=\"thumbnail\">http://2.png</image>"
@@ -346,7 +346,7 @@ ch_test_app_func (void)
"<screenshot type=\"default\">"
"<image type=\"thumbnail\" height=\"351\" width=\"624\">http://a.png</image>"
"</screenshot>"
- "<screenshot type=\"normal\">"
+ "<screenshot>"
"<image type=\"thumbnail\">http://b.png</image>"
"</screenshot>"
"</screenshots>"