Commit 814d1bc7 authored by Matthias Klumpp's avatar Matthias Klumpp
Browse files

trivial: rename XML node locale match function

The function still had its old name which sounded like you would get the
actual locale with it, which is not the purpose of this function.
parent 190fc74f
......@@ -313,7 +313,7 @@ as_agreement_section_load_from_xml (AsAgreementSection *agreement_section, AsCon
if (iter->type != XML_ELEMENT_NODE)
continue;
lang = as_xmldata_get_node_locale (ctx, iter);
lang = as_xml_get_node_locale_match (ctx, iter);
if (g_strcmp0 ((gchar*) iter->name, "name") == 0) {
g_autofree gchar *content = NULL;
......
......@@ -3664,7 +3664,7 @@ as_component_load_from_xml (AsComponent *cpt, AsContext *ctx, xmlNode *node, GEr
node_name = (const gchar*) iter->name;
content = as_xml_get_node_value (iter);
lang = as_xmldata_get_node_locale (ctx, iter);
lang = as_xml_get_node_locale_match (ctx, iter);
tag_id = as_xml_tag_from_string (node_name);
......
......@@ -288,7 +288,7 @@ as_image_load_from_xml (AsImage *image, AsContext *ctx, xmlNode *node, GError **
if (content == NULL)
return FALSE;
lang = as_xmldata_get_node_locale (ctx, node);
lang = as_xml_get_node_locale_match (ctx, node);
/* check if this image is for us */
if (lang == NULL)
......
......@@ -936,7 +936,7 @@ as_release_load_from_xml (AsRelease *release, AsContext *ctx, xmlNode *node, GEr
/* for collection XML, the "description" tag has a language property, so parsing it is simple */
content = as_xml_dump_node_children (iter);
lang = as_xmldata_get_node_locale (ctx, iter);
lang = as_xml_get_node_locale_match (ctx, iter);
if (lang != NULL)
as_release_set_description (release, content, lang);
} else {
......
......@@ -499,7 +499,7 @@ as_screenshot_load_from_xml (AsScreenshot *screenshot, AsContext *ctx, xmlNode *
if (content == NULL)
continue;
lang = as_xmldata_get_node_locale (ctx, iter);
lang = as_xml_get_node_locale_match (ctx, iter);
if (lang != NULL)
as_screenshot_set_caption (screenshot, content, lang);
}
......
......@@ -356,7 +356,7 @@ as_video_load_from_xml (AsVideo *video, AsContext *ctx, xmlNode *node, GError **
if (content == NULL)
return FALSE;
lang = as_xmldata_get_node_locale (ctx, node);
lang = as_xml_get_node_locale_match (ctx, node);
/* check if this video is for us */
if (lang == NULL)
......
......@@ -45,14 +45,14 @@ as_xml_get_node_value (xmlNode *node)
}
/**
* as_xmldata_get_node_locale:
* as_xml_get_node_locale_match:
* @node: A XML node
*
* Returns: The locale of a node, if the node should be considered for inclusion.
* %NULL if the node should be ignored due to a not-matching locale.
*/
gchar*
as_xmldata_get_node_locale (AsContext *ctx, xmlNode *node)
as_xml_get_node_locale_match (AsContext *ctx, xmlNode *node)
{
gchar *lang;
......@@ -358,7 +358,7 @@ as_xml_parse_metainfo_description_node (AsContext *ctx, xmlNode *node, GHFunc fu
g_autofree gchar *lang = NULL;
g_autofree gchar *content = NULL;
lang = as_xmldata_get_node_locale (ctx, iter);
lang = as_xml_get_node_locale_match (ctx, iter);
if (lang == NULL)
/* this locale is not for us */
continue;
......@@ -395,7 +395,7 @@ as_xml_parse_metainfo_description_node (AsContext *ctx, xmlNode *node, GHFunc fu
if (iter2_tag_id != AS_TAG_LI)
continue;
lang = as_xmldata_get_node_locale (ctx, iter2);
lang = as_xml_get_node_locale_match (ctx, iter2);
if (lang == NULL)
continue;
......@@ -739,7 +739,7 @@ as_xml_set_out_of_context_error (gchar **error_msg_ptr)
}
/**
* as_xmldata_parse_document:
* as_xml_parse_document:
*/
xmlDoc*
as_xml_parse_document (const gchar *data, gssize len, GError **error)
......
......@@ -35,8 +35,8 @@ G_BEGIN_DECLS
#pragma GCC visibility push(hidden)
gchar *as_xml_get_node_value (xmlNode *node);
gchar *as_xmldata_get_node_locale (AsContext *ctx,
xmlNode *node);
gchar *as_xml_get_node_locale_match (AsContext *ctx,
xmlNode *node);
void as_xml_add_children_values_to_array (xmlNode *node,
const gchar *element_name,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment