aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-05-25 01:53:10 +0800
committerChris Toshok <toshok@src.gnome.org>2004-05-25 01:53:10 +0800
commit0235a365dd12798e7b8f1881d053f96485009d4d (patch)
treec7e6c1bfb3f1062346004b392e2bd993310ed3f3 /addressbook
parent34f977f6dc01f2af3cadbbcecbdf4212eee2f392 (diff)
downloadgsoc2013-evolution-0235a365dd12798e7b8f1881d053f96485009d4d.tar.gz
gsoc2013-evolution-0235a365dd12798e7b8f1881d053f96485009d4d.tar.zst
gsoc2013-evolution-0235a365dd12798e7b8f1881d053f96485009d4d.zip
[ fixes bug #32194 ]
2004-05-24 Chris Toshok <toshok@ximian.com> [ fixes bug #32194 ] * importers/evolution-vcard-importer.c (process_item_fn): make sure all ADR attributes have HOME/WORK/OTHER. svn path=/trunk/; revision=26064
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/importers/evolution-vcard-importer.c40
2 files changed, 47 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 92939906aa..e70f83847f 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,12 @@
2004-05-24 Chris Toshok <toshok@ximian.com>
+ [ fixes bug #32194 ]
+
+ * importers/evolution-vcard-importer.c (process_item_fn): make
+ sure all ADR attributes have HOME/WORK/OTHER.
+
+2004-05-24 Chris Toshok <toshok@ximian.com>
+
[ fixes bug #40013 ]
* importers/evolution-vcard-importer.c (process_item_fn): for TEL
diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c
index 950eac9b7f..3a580029ef 100644
--- a/addressbook/importers/evolution-vcard-importer.c
+++ b/addressbook/importers/evolution-vcard-importer.c
@@ -200,6 +200,46 @@ process_item_fn (EvolutionImporter *importer,
}
}
+ /*
+ Deal with ADR attributes that don't conform to what we need.
+
+ if HOME or WORK isn't specified, add TYPE=OTHER.
+ */
+ attrs = e_vcard_get_attributes (E_VCARD (contact));
+ for (attr = attrs; attr; attr = attr->next) {
+ EVCardAttribute *a = attr->data;
+ gboolean no_location = TRUE;
+ GList *params, *param;
+
+ if (g_ascii_strcasecmp (e_vcard_attribute_get_name (a),
+ EVC_ADR))
+ continue;
+
+ params = e_vcard_attribute_get_params (a);
+ for (param = params; param; param = param->next) {
+ EVCardAttributeParam *p = param->data;
+ GList *vs, *v;
+
+ if (g_ascii_strcasecmp (e_vcard_attribute_param_get_name (p),
+ EVC_TYPE))
+ continue;
+
+ vs = e_vcard_attribute_param_get_values (p);
+ for (v = vs; v; v = v->next) {
+ if (!g_ascii_strcasecmp ((char*)v->data, "WORK") ||
+ !g_ascii_strcasecmp ((char*)v->data, "HOME"))
+ no_location = FALSE;
+ }
+ }
+
+ if (no_location) {
+ /* add OTHER */
+ e_vcard_attribute_add_param_with_value (a,
+ e_vcard_attribute_param_new (EVC_TYPE),
+ "OTHER");
+ }
+ }
+
/* Work around the fact that these fields no longer show up in the UI */
add_to_notes (contact, E_CONTACT_OFFICE);
add_to_notes (contact, E_CONTACT_SPOUSE);