Make get_by_xpath() string return value a maybe-string

This commit is contained in:
Gergely Polonkai 2013-10-05 03:23:38 +02:00
parent 096111684e
commit f7e4c451b4

View File

@ -293,7 +293,7 @@ get_by_xpath(xmlXPathContextPtr xpath_context, const gchar *uri, const gchar *xp
switch (type) { switch (type) {
case XML_CONVERT_STRING: case XML_CONVERT_STRING:
ret = g_variant_new_string(text); ret = g_variant_new("ms", text);
break; break;
@ -334,9 +334,10 @@ ag_chart_load_from_file(GFile *file, GError **err)
AgChart *chart = NULL; AgChart *chart = NULL;
gchar *uri; gchar *uri;
gchar *xml = NULL; gchar *xml = NULL;
gchar *name;
gchar *country_name; gchar *country_name;
gchar *city_name; gchar *city_name;
guint length; gsize length;
xmlDocPtr doc; xmlDocPtr doc;
xmlXPathContextPtr xpath_context; xmlXPathContextPtr xpath_context;
GVariant *chart_name; GVariant *chart_name;
@ -477,8 +478,10 @@ ag_chart_load_from_file(GFile *file, GError **err)
g_variant_unref(latitude); g_variant_unref(latitude);
g_variant_unref(altitude); g_variant_unref(altitude);
ag_chart_set_name(chart, g_variant_get_string(chart_name, NULL)); g_variant_get(chart_name, "ms", &name);
g_variant_unref(chart_name); g_variant_unref(chart_name);
ag_chart_set_name(chart, name);
g_free(name);
g_variant_get(country, "ms", &country_name); g_variant_get(country, "ms", &country_name);
g_variant_unref(country); g_variant_unref(country);