diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-05-17 21:49:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-05-17 21:49:21 +0800 |
commit | ea1a5fca456b891f8bb9ab248ad65651b66b54b2 (patch) | |
tree | 9619f2f9631aac471da3f8b24dd30908335627c9 /addressbook | |
parent | c20b1701e81473504f1d67f6e7387a6f1e5fb856 (diff) | |
parent | 99ebc23e0860ef5baf1f169803d751db70e2aa32 (diff) | |
download | gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.gz gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.bz2 gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.lz gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.xz gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.zst gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.zip |
Merge branch 'gnome-2-30' into express2
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 1 | ||||
-rw-r--r-- | addressbook/importers/evolution-vcard-importer.c | 31 |
2 files changed, 20 insertions, 12 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 6ffeee56a0..d3538899ba 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1237,7 +1237,6 @@ e_addressbook_view_print (EAddressbookView *view, widget = gtk_bin_get_child (GTK_BIN (view)); printable = e_table_get_printable (E_TABLE (widget)); g_object_ref_sink (printable); - g_object_unref (widget); e_contact_print_button (printable, action); 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"); + } } } |