diff options
author | Richard Hughes <richard@hughsie.com> | 2014-04-08 11:44:23 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-04-08 11:44:23 +0100 |
commit | 9d18b5e4f5065b7e5106c28d006f470374881918 (patch) | |
tree | 94ac1652c72cf53de8b23891b6812545425b20af | |
parent | d62a1fb592fd4bdadd3178215ee5067c40586cf4 (diff) | |
download | appstream-glib-9d18b5e4f5065b7e5106c28d006f470374881918.tar.gz |
Use the legacy names when using as_node_get_tag()
We don't want to have to do this manually for each user.
-rw-r--r-- | libappstream-glib/as-node.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c index 33df231..2a531f1 100644 --- a/libappstream-glib/as-node.c +++ b/libappstream-glib/as-node.c @@ -764,10 +764,20 @@ AsTag as_node_get_tag (const GNode *node) { AsNodeData *data; + const gchar *tmp; + g_return_val_if_fail (node != NULL, AS_TAG_UNKNOWN); + data = (AsNodeData *) node->data; if (data == NULL) return AS_TAG_UNKNOWN; + + /* try to match with a fallback */ + if (data->tag == AS_TAG_UNKNOWN) { + tmp = as_tag_data_get_name (data); + return as_tag_from_string_full (tmp, AS_TAG_FLAG_USE_FALLBACKS); + } + return data->tag; } |