[gnome-software/gnome-3-10] Do not fail to parse if the AppStream metadata contains unknown tags



commit 389789210ee1322f80e795bc6bedfe77d5e380d0
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 a4e3682..d8df24d 100644
--- a/src/plugins/appstream-cache.c
+++ b/src/plugins/appstream-cache.c
@@ -205,6 +205,7 @@ typedef struct {
        char                    *lang_temp;
        AppstreamCache          *cache;
        AppstreamCacheSection    section;
+       AppstreamCacheSection    section_last_known;
 } AppstreamCacheHelper;
 
 /**
@@ -304,6 +305,7 @@ appstream_cache_start_element_cb (GMarkupParseContext *context,
                break;
        default:
                /* ignore unknown entries */
+               helper->section_last_known = helper->section;
                break;
        }
 
@@ -419,7 +421,7 @@ appstream_cache_end_element_cb (GMarkupParseContext *context,
                break;
        default:
                /* ignore unknown entries */
-               helper->section = APPSTREAM_CACHE_SECTION_APPLICATION;
+               helper->section = helper->section_last_known;
                break;
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]