aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-xml-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-xml-utils.c')
-rw-r--r--e-util/e-xml-utils.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c
index 4710c8bced..701598e000 100644
--- a/e-util/e-xml-utils.c
+++ b/e-util/e-xml-utils.c
@@ -120,6 +120,26 @@ e_xml_get_bool_prop_by_name(const xmlNode *parent, const xmlChar *prop_name)
return ret_val;
}
+gboolean
+e_xml_get_bool_prop_by_name_with_default(const xmlNode *parent, const xmlChar *prop_name, gboolean def)
+{
+ xmlChar *prop;
+ gboolean ret_val = def;
+
+ g_return_val_if_fail (parent != NULL, 0);
+ g_return_val_if_fail (prop_name != NULL, 0);
+
+ prop = xmlGetProp ((xmlNode *)parent, prop_name);
+ if (prop) {
+ if(!strcasecmp(prop, "true"))
+ ret_val = TRUE;
+ else
+ ret_val = FALSE;
+ xmlFree(prop);
+ }
+ return ret_val;
+}
+
void
e_xml_set_bool_prop_by_name(xmlNode *parent, const xmlChar *prop_name, gboolean value)
{