From 829150f922fdf348de15ef195abf07f19e3f97dd Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 31 May 2007 13:08:31 +0000 Subject: Add e_vcard_attribute_remove_param(). 2007-05-31 Ross Burton * libebook/e-vcard.[ch]: Add e_vcard_attribute_remove_param(). svn path=/trunk/; revision=7791 --- addressbook/ChangeLog | 5 +++++ addressbook/libebook/e-vcard.c | 29 +++++++++++++++++++++++++++++ addressbook/libebook/e-vcard.h | 1 + 3 files changed, 35 insertions(+) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 7fae06c03..0a47d7dd0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,8 @@ +2007-05-31 Ross Burton + + * libebook/e-vcard.[ch]: + Add e_vcard_attribute_remove_param(). + 2007-05-24 Ross Burton * libebook/e-contact.c: diff --git a/addressbook/libebook/e-vcard.c b/addressbook/libebook/e-vcard.c index 72043bfb6..5eb3a38b4 100644 --- a/addressbook/libebook/e-vcard.c +++ b/addressbook/libebook/e-vcard.c @@ -1304,6 +1304,35 @@ e_vcard_attribute_remove_value (EVCardAttribute *attr, const char *s) attr->values = g_list_delete_link (attr->values, l); } +/** + * e_vcard_attribute_remove_param: + * @attr: an #EVCardAttribute + * @param_name: a parameter name + * + * Removes the parameter @param_name from the attribute @attr. + * + * Since 1.11.3. + */ +void +e_vcard_attribute_remove_param (EVCardAttribute *attr, const char *param_name) +{ + GList *l; + EVCardAttributeParam *param; + + g_return_if_fail (attr != NULL); + g_return_if_fail (param_name != NULL); + + for (l = attr->params; l; l = l->next) { + param = l->data; + if (g_ascii_strcasecmp (e_vcard_attribute_param_get_name (param), + param_name) == 0) { + attr->params = g_list_delete_link (attr->params, l); + e_vcard_attribute_param_free(param); + break; + } + } +} + /** * e_vcard_attribute_remove_params: * @attr: an #EVCardAttribute diff --git a/addressbook/libebook/e-vcard.h b/addressbook/libebook/e-vcard.h index 093e8d53b..84fe9cee0 100644 --- a/addressbook/libebook/e-vcard.h +++ b/addressbook/libebook/e-vcard.h @@ -151,6 +151,7 @@ void e_vcard_attribute_add_values (EVCardAttribute *attr, ... void e_vcard_attribute_remove_value (EVCardAttribute *attr, const char *s); void e_vcard_attribute_remove_values (EVCardAttribute *attr); void e_vcard_attribute_remove_params (EVCardAttribute *attr); +void e_vcard_attribute_remove_param (EVCardAttribute *attr, const char *param_name); void e_vcard_attribute_remove_param_value (EVCardAttribute *attr, const char *param_name, const char *s); /* attribute parameters */ -- cgit v1.2.1