diff options
author | Ross Burton <ross@openedhand.com> | 2007-05-31 13:08:31 +0000 |
---|---|---|
committer | Ross Burton <rburton@src.gnome.org> | 2007-05-31 13:08:31 +0000 |
commit | 829150f922fdf348de15ef195abf07f19e3f97dd (patch) | |
tree | 1cd08e26d8b4131cbca45aa871fff5e10d6cd545 /addressbook | |
parent | 2d7b2eec5ca806685f7df6bfeecd031a86c38b71 (diff) | |
download | evolution-data-server-829150f922fdf348de15ef195abf07f19e3f97dd.tar.gz |
Add e_vcard_attribute_remove_param().
2007-05-31 Ross Burton <ross@openedhand.com>
* libebook/e-vcard.[ch]:
Add e_vcard_attribute_remove_param().
svn path=/trunk/; revision=7791
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 5 | ||||
-rw-r--r-- | addressbook/libebook/e-vcard.c | 29 | ||||
-rw-r--r-- | addressbook/libebook/e-vcard.h | 1 |
3 files changed, 35 insertions, 0 deletions
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 <ross@openedhand.com> + + * libebook/e-vcard.[ch]: + Add e_vcard_attribute_remove_param(). + 2007-05-24 Ross Burton <ross@openedhand.com> * 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 @@ -1305,6 +1305,35 @@ e_vcard_attribute_remove_value (EVCardAttribute *attr, const char *s) } /** + * 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 */ |