diff options
author | Michael Meeks <michael.meeks@novell.com> | 2010-05-19 22:22:23 +0800 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-05-19 22:22:23 +0800 |
commit | 9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1 (patch) | |
tree | e4815398dbd17e1b87f8bf220b106e5a017e1179 /addressbook/importers/evolution-vcard-importer.c | |
parent | 2566a8549d7fd878226aeb9269f2d5871a5eddc2 (diff) | |
parent | ea1a5fca456b891f8bb9ab248ad65651b66b54b2 (diff) | |
download | gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.gz gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.bz2 gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.lz gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.xz gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.zst gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.zip |
Merge commit 'origin/express2' into express2
Diffstat (limited to 'addressbook/importers/evolution-vcard-importer.c')
-rw-r--r-- | addressbook/importers/evolution-vcard-importer.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 1222566387..080ef940f2 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -138,6 +138,7 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) EVCardAttribute *a = attr->data; gboolean location_only = TRUE; gboolean no_location = TRUE; + gboolean is_work_home = FALSE; GList *params, *param; if (g_ascii_strcasecmp (e_vcard_attribute_get_name (a), @@ -155,6 +156,10 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) vs = e_vcard_attribute_param_get_values (p); for (v = vs; v; v = v->next) { + is_work_home = is_work_home || + !g_ascii_strcasecmp ((gchar *)v->data, "WORK") || + !g_ascii_strcasecmp ((gchar *)v->data, "HOME"); + if (!g_ascii_strcasecmp ((gchar *)v->data, "WORK") || !g_ascii_strcasecmp ((gchar *)v->data, "HOME") || !g_ascii_strcasecmp ((gchar *)v->data, "OTHER")) @@ -164,17 +169,21 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) } } - if (location_only) { - /* add VOICE */ - e_vcard_attribute_add_param_with_value (a, - e_vcard_attribute_param_new (EVC_TYPE), - "VOICE"); - } - if (no_location) { - /* add OTHER */ - e_vcard_attribute_add_param_with_value (a, - e_vcard_attribute_param_new (EVC_TYPE), - "OTHER"); + if (is_work_home) { + /* only WORK and HOME phone numbers require locations, + the rest should be kept as is */ + if (location_only) { + /* add VOICE */ + e_vcard_attribute_add_param_with_value (a, + e_vcard_attribute_param_new (EVC_TYPE), + "VOICE"); + } + if (no_location) { + /* add OTHER */ + e_vcard_attribute_add_param_with_value (a, + e_vcard_attribute_param_new (EVC_TYPE), + "OTHER"); + } } } |