[gnome-software] Do not fail to parse if the AppStream metadata contains unknown tags
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Do not fail to parse if the AppStream metadata contains unknown tags
- Date: Thu, 24 Oct 2013 10:21:34 +0000 (UTC)
commit 82af8d3ff363dab072551ef1123e0f38c6ddd1e1
Author: Richard Hughes <richard hughsie com>
Date: Thu Oct 24 11:03:07 2013 +0100
Do not fail to parse if the AppStream metadata contains unknown tags
This worked before if the unknown tag was in the root <application> but fails
if it appears anywhere like <screenshots> or <keywords>
src/plugins/appstream-cache.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/appstream-cache.c b/src/plugins/appstream-cache.c
index 7d1bef8..d2f4634 100644
--- a/src/plugins/appstream-cache.c
+++ b/src/plugins/appstream-cache.c
@@ -118,6 +118,7 @@ typedef struct {
gchar *url_type_temp;
AppstreamCache *cache;
AppstreamTag tag;
+ AppstreamTag tag_last_known;
AppstreamImage *image;
AppstreamScreenshot *screenshot;
gint priority;
@@ -396,6 +397,7 @@ appstream_cache_start_element_cb (GMarkupParseContext *context,
break;
default:
/* ignore unknown entries */
+ helper->tag_last_known = helper->tag;
break;
}
@@ -545,7 +547,7 @@ appstream_cache_end_element_cb (GMarkupParseContext *context,
break;
default:
/* ignore unknown entries */
- helper->tag = APPSTREAM_TAG_APPLICATION;
+ helper->tag = helper->tag_last_known;
break;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]