aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorSushma Rai <rsushma@src.gnome.org>2005-08-17 19:12:04 +0800
committerSushma Rai <rsushma@src.gnome.org>2005-08-17 19:12:04 +0800
commitdedae38804fb2f619e4e8b3d640848c9cc8ad291 (patch)
tree465329d6dd969a2762b6cce1f5294f0e445e86be /addressbook/gui
parent8b340ced999feeeaeb856ca0a414db7ffc20e645 (diff)
downloadgsoc2013-evolution-dedae38804fb2f619e4e8b3d640848c9cc8ad291.tar
gsoc2013-evolution-dedae38804fb2f619e4e8b3d640848c9cc8ad291.tar.gz
gsoc2013-evolution-dedae38804fb2f619e4e8b3d640848c9cc8ad291.tar.bz2
gsoc2013-evolution-dedae38804fb2f619e4e8b3d640848c9cc8ad291.tar.lz
gsoc2013-evolution-dedae38804fb2f619e4e8b3d640848c9cc8ad291.tar.xz
gsoc2013-evolution-dedae38804fb2f619e4e8b3d640848c9cc8ad291.tar.zst
gsoc2013-evolution-dedae38804fb2f619e4e8b3d640848c9cc8ad291.zip
Not checking for the duplicate contacts matching emial ids of a list.
skip email comparison in case of contact lists. Fixes #312554. svn path=/trunk/; revision=30146
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/merging/eab-contact-compare.c72
1 files changed, 38 insertions, 34 deletions
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c
index 5cfb8af0e2..7fcaef7ea0 100644
--- a/addressbook/gui/merging/eab-contact-compare.c
+++ b/addressbook/gui/merging/eab-contact-compare.c
@@ -559,12 +559,14 @@ eab_contact_compare (EContact *contact1, EContact *contact2)
g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE);
result = EAB_CONTACT_MATCH_NONE;
- result = combine_comparisons (result, eab_contact_compare_name (contact1, contact2));
- result = combine_comparisons (result, eab_contact_compare_nickname (contact1, contact2));
- if(!e_contact_get (contact2, E_CONTACT_IS_LIST))
- result = combine_comparisons (result, eab_contact_compare_email (contact1, contact2));
- result = combine_comparisons (result, eab_contact_compare_address (contact1, contact2));
- result = combine_comparisons (result, eab_contact_compare_telephone (contact1, contact2));
+ if(!e_contact_get (contact1, E_CONTACT_IS_LIST)){
+ result = combine_comparisons (result, eab_contact_compare_name (contact1, contact2));
+ result = combine_comparisons (result, eab_contact_compare_nickname (contact1, contact2));
+ if(!e_contact_get (contact2, E_CONTACT_IS_LIST))
+ result = combine_comparisons (result, eab_contact_compare_email (contact1, contact2));
+ result = combine_comparisons (result, eab_contact_compare_address (contact1, contact2));
+ result = combine_comparisons (result, eab_contact_compare_telephone (contact1, contact2));
+ }
result = combine_comparisons (result, eab_contact_compare_file_as (contact1, contact2));
return result;
@@ -681,41 +683,43 @@ use_common_book_cb (EBook *book, gpointer closure)
g_free (contact_file_as);
}
- contact_name = e_contact_get (contact, E_CONTACT_NAME);
- if (contact_name) {
- if (contact_name->given && *contact_name->given)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->given);
-
- if (contact_name->additional && *contact_name->additional)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->additional);
+ if (!e_contact_get (contact, E_CONTACT_IS_LIST)) {
+ contact_name = e_contact_get (contact, E_CONTACT_NAME);
+ if (contact_name) {
+ if (contact_name->given && *contact_name->given)
+ query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->given);
- if (contact_name->family && *contact_name->family)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->family);
-
- e_contact_name_free (contact_name);
- }
+ if (contact_name->additional && *contact_name->additional)
+ query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->additional);
+
+ if (contact_name->family && *contact_name->family)
+ query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->family);
- contact_email = e_contact_get (contact, E_CONTACT_EMAIL);
- if (contact_email) {
- GList *iter;
- for (iter = contact_email; iter && p < MAX_QUERY_PARTS; iter = iter->next) {
- gchar *addr = g_strdup (iter->data);
- if (addr && *addr) {
- gchar *s = addr;
- while (*s) {
- if (*s == '@') {
- *s = '\0';
- break;
+ e_contact_name_free (contact_name);
+ }
+
+ contact_email = e_contact_get (contact, E_CONTACT_EMAIL);
+ if (contact_email) {
+ GList *iter;
+ for (iter = contact_email; iter && p < MAX_QUERY_PARTS; iter = iter->next) {
+ gchar *addr = g_strdup (iter->data);
+ if (addr && *addr) {
+ gchar *s = addr;
+ while (*s) {
+ if (*s == '@') {
+ *s = '\0';
+ break;
+ }
+ ++s;
}
- ++s;
+ query_parts[p++] = g_strdup_printf ("(beginswith \"email\" \"%s\")", addr);
+ g_free (addr);
}
- query_parts[p++] = g_strdup_printf ("(beginswith \"email\" \"%s\")", addr);
- g_free (addr);
}
}
+ g_list_foreach (contact_email, (GFunc)g_free, NULL);
+ g_list_free (contact_email);
}
- g_list_foreach (contact_email, (GFunc)g_free, NULL);
- g_list_free (contact_email);
/* Build up our full query from the parts. */