summaryrefslogtreecommitdiff
path: root/gdata/gdata-parser.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2010-03-25 00:43:09 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2010-03-25 23:05:07 +0000
commitaa23ec1cdcaaa5511a5ba713bebdbe0f101bf180 (patch)
tree212aef6ccddf46209dcb472d3a5eae076d8469c3 /gdata/gdata-parser.c
parent3dad7fe3e3b48fd7090b21dc92ed770c338732da (diff)
downloadlibgdata-aa23ec1cdcaaa5511a5ba713bebdbe0f101bf180.tar.gz
Bug 613551 — Add gContact namespace
Add support for various elements from the gContact namespace, and implement them in #GDataContactsContact. There is now support for contact: * nicknames * birthdays * jots (notes about a contact) * relations (with other people, not necessarily family) * websites * events (anniversaries, important dates, etc.) * calendar links Helps: bgo#613551
Diffstat (limited to 'gdata/gdata-parser.c')
-rw-r--r--gdata/gdata-parser.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdata/gdata-parser.c b/gdata/gdata-parser.c
index b580076b..e59a5174 100644
--- a/gdata/gdata-parser.c
+++ b/gdata/gdata-parser.c
@@ -145,6 +145,31 @@ gdata_parser_error_required_property_missing (xmlNode *element, const gchar *pro
}
gboolean
+gdata_parser_error_mutexed_properties (xmlNode *element, const gchar *property1_name, const gchar *property2_name, GError **error)
+{
+ gchar *property1_string, *property2_string, *element_string;
+
+ property1_string = g_strdup_printf ("@%s", property1_name);
+ property2_string = g_strdup_printf ("@%s", property2_name);
+ element_string = print_element (element);
+
+ g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR,
+ /* Translators: the first two parameters are the names of XML properties of an XML element given in the third
+ * parameter (including the angle brackets ("<" and ">")).
+ *
+ * For example:
+ * Values were present for properties @rel and @label of a <entry/gContact:relation> element when only one of the
+ * two is allowed. */
+ _("Values were present for properties %s and %s of a %s element when only one of the two is allowed."),
+ property1_string, property2_string, element_string);
+ g_free (property1_string);
+ g_free (property2_string);
+ g_free (element_string);
+
+ return FALSE;
+}
+
+gboolean
gdata_parser_error_required_element_missing (const gchar *element_name, const gchar *parent_element_name, GError **error)
{
/* NOTE: This can't take an xmlNode, since such a node wouldn't exist. */