aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--addressbook/ChangeLog11
-rw-r--r--addressbook/gui/merging/eab-contact-compare.c72
2 files changed, 49 insertions, 34 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index c2bed2deac..dcb4d88ab2 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,16 @@
2005-08-17 Devashish Sharma <sdevashish@novell.com>
+ * gui/merging/eab-contact-compare.c (use_common_book_cb): When
+ adding/modifying a contact list there is no need to check if the emails
+ in the list are there in existing contact lists or contacts. Also there
+ is no need for comparing EContactName in case of contact list. Added a
+ condition to check this.
+ (eab_contact_compare): Added a check to skip email comparison in case
+ of contact list.
+ Fixes #312554.
+
+2005-08-17 Devashish Sharma <sdevashish@novell.com>
+
* gui/merging/eab-contact-compare.c (eab_contact_compare): Add an email
which is not there in any contact to a contact list, now if you want
to add a contact with that email id it gives you duplicate detected. So
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. */