diff options
author | Richard Hughes <richard@hughsie.com> | 2014-06-06 11:02:07 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-06-06 11:02:25 +0100 |
commit | 4f6e1230f7f3d7df873d85d5be5c1a404c3787e5 (patch) | |
tree | 9e2068734b4d362cdfb19ab16da4162a8febb32c | |
parent | c7421b696dd3fa56aa9c5ce85e5c3eb3991c59d3 (diff) | |
download | appstream-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.c | 7 | ||||
-rw-r--r-- | libappstream-glib/as-self-test.c | 4 |
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>" |