summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-04-08 11:44:23 +0100
committerRichard Hughes <richard@hughsie.com>2014-04-08 11:44:23 +0100
commit9d18b5e4f5065b7e5106c28d006f470374881918 (patch)
tree94ac1652c72cf53de8b23891b6812545425b20af
parentd62a1fb592fd4bdadd3178215ee5067c40586cf4 (diff)
downloadappstream-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.c10
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;
}