evolution-data-server r10059 - in trunk/addressbook: . libebook
- From: rburton svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r10059 - in trunk/addressbook: . libebook
- Date: Mon, 16 Feb 2009 12:42:14 +0000 (UTC)
Author: rburton
Date: Mon Feb 16 12:42:14 2009
New Revision: 10059
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=10059&view=rev
Log:
2009-02-16 Ross Burton <ross linux intel com>
* libebook/e-contact.c:
* libebook/e-contact.h:
Add e_contact_field_id_from_vcard().
Modified:
trunk/addressbook/ChangeLog
trunk/addressbook/libebook/e-contact.c
trunk/addressbook/libebook/e-contact.h
Modified: trunk/addressbook/libebook/e-contact.c
==============================================================================
--- trunk/addressbook/libebook/e-contact.c (original)
+++ trunk/addressbook/libebook/e-contact.c Mon Feb 16 12:42:14 2009
@@ -1380,6 +1380,32 @@
}
/**
+ * e_contact_field_id_from_vcard:
+ * @vcard_field: a string representing a vCard field
+ *
+ * Gets the #EContactField corresponding to the @vcard_field.
+ *
+ * Return value: An #EContactField corresponding to @vcard_field, or %0 if it doesn't exist.
+ **/
+EContactField
+e_contact_field_id_from_vcard (const char *vcard_field)
+{
+ int i;
+
+ for (i = E_CONTACT_FIELD_FIRST; i < E_CONTACT_FIELD_LAST; i ++) {
+ if (field_info[i].vcard_field_name == NULL)
+ continue;
+ if (field_info[i].t & E_CONTACT_FIELD_TYPE_SYNTHETIC)
+ continue;
+ if (!strcmp (field_info[i].vcard_field_name, vcard_field))
+ return field_info[i].field_id;
+ }
+
+ g_warning ("unknown vCard field `%s'", vcard_field);
+ return 0;
+}
+
+/**
* e_contact_get:
* @contact: an #EContact
* @field_id: an #EContactField
Modified: trunk/addressbook/libebook/e-contact.h
==============================================================================
--- trunk/addressbook/libebook/e-contact.h (original)
+++ trunk/addressbook/libebook/e-contact.h Mon Feb 16 12:42:14 2009
@@ -344,6 +344,7 @@
const char* e_contact_pretty_name (EContactField field_id);
const char* e_contact_vcard_attribute (EContactField field_id);
EContactField e_contact_field_id (const char *field_name);
+EContactField e_contact_field_id_from_vcard (const char *vcard_field);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]