diff options
author | Richard Hughes <richard@hughsie.com> | 2016-11-03 15:58:02 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-11-03 16:03:49 +0000 |
commit | e820ab1fec6a8fdedd5931c7681d9a59094a289e (patch) | |
tree | dbec3e0a4de001d8d857aee0088bfb568776c034 /libappstream-glib/as-node.h | |
parent | abfed95fcf149dbd33473a516dc295a21e0eeb20 (diff) | |
download | appstream-glib-e820ab1fec6a8fdedd5931c7681d9a59094a289e.tar.gz |
Only load native languages when parsing AppStream data
This adds an optional flag that allows the node parser to ignore any nodes that
do not match the native languages of the user. This increases startup speed of
gnome-software by ~40ms but also drops the RSS by a massive 12Mb for the Fedora
AppStream file.
Diffstat (limited to 'libappstream-glib/as-node.h')
-rw-r--r-- | libappstream-glib/as-node.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libappstream-glib/as-node.h b/libappstream-glib/as-node.h index d18c924..e3fe936 100644 --- a/libappstream-glib/as-node.h +++ b/libappstream-glib/as-node.h @@ -61,13 +61,15 @@ typedef enum { * @AS_NODE_FROM_XML_FLAG_NONE: No extra flags to use * @AS_NODE_FROM_XML_FLAG_LITERAL_TEXT: Treat the text as an exact string * @AS_NODE_FROM_XML_FLAG_KEEP_COMMENTS: Retain comments in the XML file + * @AS_NODE_FROM_XML_FLAG_ONLY_NATIVE_LANGS: Only load native languages * * The flags for converting from XML. **/ typedef enum { - AS_NODE_FROM_XML_FLAG_NONE = 0, /* Since: 0.1.0 */ - AS_NODE_FROM_XML_FLAG_LITERAL_TEXT = 1, /* Since: 0.1.3 */ - AS_NODE_FROM_XML_FLAG_KEEP_COMMENTS = 2, /* Since: 0.1.6 */ + AS_NODE_FROM_XML_FLAG_NONE = 0, /* Since: 0.1.0 */ + AS_NODE_FROM_XML_FLAG_LITERAL_TEXT = 1 << 0, /* Since: 0.1.3 */ + AS_NODE_FROM_XML_FLAG_KEEP_COMMENTS = 1 << 1, /* Since: 0.1.6 */ + AS_NODE_FROM_XML_FLAG_ONLY_NATIVE_LANGS = 1 << 2, /* Since: 0.6.5 */ /*< private >*/ AS_NODE_FROM_XML_FLAG_LAST } AsNodeFromXmlFlags; |