aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/importers
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-05-10 18:10:45 +0800
committerMilan Crha <mcrha@redhat.com>2010-05-10 18:10:45 +0800
commitb41e9b362942d7503e9f61d503dd23ffb007ddf5 (patch)
tree1b9725b2f1269fd8ee87d33245e1048924a0be08 /addressbook/importers
parentd8df50d395c42d8e82e0a895d3bd1f2fa4ee901d (diff)
downloadgsoc2013-evolution-b41e9b362942d7503e9f61d503dd23ffb007ddf5.tar
gsoc2013-evolution-b41e9b362942d7503e9f61d503dd23ffb007ddf5.tar.gz
gsoc2013-evolution-b41e9b362942d7503e9f61d503dd23ffb007ddf5.tar.bz2
gsoc2013-evolution-b41e9b362942d7503e9f61d503dd23ffb007ddf5.tar.lz
gsoc2013-evolution-b41e9b362942d7503e9f61d503dd23ffb007ddf5.tar.xz
gsoc2013-evolution-b41e9b362942d7503e9f61d503dd23ffb007ddf5.tar.zst
gsoc2013-evolution-b41e9b362942d7503e9f61d503dd23ffb007ddf5.zip
Bug #618177 - Mobile Phone of imported contact not shown in preview
Diffstat (limited to 'addressbook/importers')
-rw-r--r--addressbook/importers/evolution-vcard-importer.c31
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");
+ }
}
}