diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-11-15 06:04:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-11-15 06:04:21 +0800 |
commit | 9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch) | |
tree | 2e1e96f33404781354c422a7e9beaf458ebeb655 /addressbook/gui/merging | |
parent | 7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff) | |
download | gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.bz2 gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.lz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.xz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.zst gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.zip |
** Remove trailing whitespace from source code.
2007-11-14 Matthew Barnes <mbarnes@redhat.com>
** Remove trailing whitespace from source code.
svn path=/trunk/; revision=34537
Diffstat (limited to 'addressbook/gui/merging')
-rw-r--r-- | addressbook/gui/merging/eab-contact-compare.c | 32 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-compare.h | 4 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-merging.c | 52 |
3 files changed, 44 insertions, 44 deletions
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index ff6e86eb6d..ae80059eaa 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -13,12 +13,12 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 @@ -91,7 +91,7 @@ name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean stri if (!(a && b && *a && *b)) return FALSE; - if(!e_utf8_casefold_collate (a, b)) + if(!e_utf8_casefold_collate (a, b)) return TRUE; /* Check for nicknames. Yes, the linear search blows. */ @@ -100,7 +100,7 @@ name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean stri if (!e_utf8_casefold_collate (name_synonyms[i][0], a) && !e_utf8_casefold_collate (name_synonyms[i][1], b)) return TRUE; - + if (!e_utf8_casefold_collate (name_synonyms[i][0], b) && !e_utf8_casefold_collate (name_synonyms[i][1], a)) return TRUE; @@ -165,7 +165,7 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb ++fragment_count; for (i = 0; familyv && familyv[i]; ++i) ++fragment_count; - + for (i = 0; namev[i] && this_part_match != EAB_CONTACT_MATCH_PART_NONE; ++i) { if (*namev[i]) { @@ -194,7 +194,7 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb if (addv && this_part_match == EAB_CONTACT_MATCH_PART_NONE) { for (j = 0; addv[j]; ++j) { if (name_fragment_match_with_synonyms (addv[j], namev[i], allow_partial_matches)) { - + this_part_match = EAB_CONTACT_MATCH_PART_ADDITIONAL_NAME; g_free (addv[j]); @@ -234,7 +234,7 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb if (match_count > 0) match_type = EAB_CONTACT_MATCH_VAGUE; - + if (fragment_count == match_count) { match_type = EAB_CONTACT_MATCH_EXACT; @@ -434,8 +434,8 @@ match_email_hostname (const gchar *addr1, const gchar *addr2) --addr2; } if((*addr1 == '@' && *addr2 != '@' ) || (*addr2 == '@' && *addr1 != '@')) - return FALSE; - + return FALSE; + return TRUE; } @@ -446,7 +446,7 @@ compare_email_addresses (const gchar *addr1, const gchar *addr2) addr2 == NULL || *addr2 == 0) return EAB_CONTACT_MATCH_NOT_APPLICABLE; - if (match_email_username (addr1, addr2)) + if (match_email_username (addr1, addr2)) return match_email_hostname (addr1, addr2) ? EAB_CONTACT_MATCH_EXACT : EAB_CONTACT_MATCH_VAGUE; return EAB_CONTACT_MATCH_NONE; @@ -487,7 +487,7 @@ eab_contact_compare_email (EContact *contact1, EContact *contact2) char *addr2 = (char *) i2->data; match = combine_comparisons (match, compare_email_addresses (addr1, addr2)); - + i2 = i2->next; } @@ -666,13 +666,13 @@ use_common_book_cb (EBook *book, gpointer closure) 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); e_contact_name_free (contact_name); } - + contact_email = e_contact_get (contact, E_CONTACT_EMAIL); if (contact_email) { GList *iter; @@ -695,8 +695,8 @@ use_common_book_cb (EBook *book, gpointer closure) g_list_foreach (contact_email, (GFunc)g_free, NULL); g_list_free (contact_email); } - - + + /* Build up our full query from the parts. */ query_parts[p] = NULL; qj = g_strjoinv (" ", query_parts); @@ -751,7 +751,7 @@ eab_contact_locate_match (EContact *contact, EABContactMatchQueryCallback cb, gp * @avoid: A list of contacts to not match. These will not show up in the search. * @cb: The function to call. * @closure: The closure to add to the call. - * + * * Look for the best match and return it using the EABContactMatchQueryCallback. **/ void diff --git a/addressbook/gui/merging/eab-contact-compare.h b/addressbook/gui/merging/eab-contact-compare.h index be835539e2..fe3891fab5 100644 --- a/addressbook/gui/merging/eab-contact-compare.h +++ b/addressbook/gui/merging/eab-contact-compare.h @@ -13,12 +13,12 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index a37f877fd8..2f6955bb0f 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -190,7 +190,7 @@ mergeit (EContactMergingLookup *lookup) dialog = (GtkDialog *)(gtk_dialog_new_with_buttons (_("Merge Contact"), NULL, GTK_DIALOG_NO_SEPARATOR, NULL)); gtk_container_border_width (GTK_CONTAINER(dialog), 5); - scrolled_window = gtk_scrolled_window_new (NULL, NULL); + scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -218,7 +218,7 @@ mergeit (EContactMergingLookup *lookup) if (string && *string) { /*Four email id's present, should be compared with all email id's in duplicate contact */ /*Merge only if number of email id's in existing contact is less than 4 */ - if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 + if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email < 4)) { row++; str = (char *)e_contact_get_const (lookup->contact, field); @@ -237,7 +237,7 @@ mergeit (EContactMergingLookup *lookup) continue; case 2: /*New contact has email and it is equal to neither of the 2 emails in the duplicate contact*/ - if((str && *str) && + if((str && *str) && (g_ascii_strcasecmp(str,e_contact_get_const (lookup->match, E_CONTACT_EMAIL_1))) && (g_ascii_strcasecmp(e_contact_get_const (lookup->match, E_CONTACT_EMAIL_2),str))) { field = E_CONTACT_EMAIL_3; @@ -247,9 +247,9 @@ mergeit (EContactMergingLookup *lookup) continue; case 3: /*New contact has email and it is equal to none of the 3 emails in the duplicate contact*/ - if((str && *str) && - (g_ascii_strcasecmp(e_contact_get_const (lookup->match, E_CONTACT_EMAIL_1),str)) && - (g_ascii_strcasecmp(e_contact_get_const (lookup->match, E_CONTACT_EMAIL_2),str)) && + if((str && *str) && + (g_ascii_strcasecmp(e_contact_get_const (lookup->match, E_CONTACT_EMAIL_1),str)) && + (g_ascii_strcasecmp(e_contact_get_const (lookup->match, E_CONTACT_EMAIL_2),str)) && (g_ascii_strcasecmp(e_contact_get_const (lookup->match, E_CONTACT_EMAIL_3),str))) field = E_CONTACT_EMAIL_4; else @@ -260,11 +260,11 @@ mergeit (EContactMergingLookup *lookup) gtk_box_pack_start (GTK_BOX(hbox), (GtkWidget*)label, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *)hbox, 0, 1, row, row + 1); - dropdown = gtk_combo_box_new_text(); + dropdown = gtk_combo_box_new_text(); gtk_combo_box_append_text (GTK_COMBO_BOX (dropdown), string); data = g_new0 (dropdown_data, 1); - + gtk_combo_box_append_text (GTK_COMBO_BOX (dropdown), ""); gtk_combo_box_set_active (GTK_COMBO_BOX (dropdown), 0); @@ -291,26 +291,26 @@ mergeit (EContactMergingLookup *lookup) gtk_box_pack_start (GTK_BOX(hbox), (GtkWidget*)label, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget*)hbox, 1, 2, row, row + 1); continue; - } + } /*for all string fields except name and email*/ if(!(string1 && *string1) || (g_ascii_strcasecmp(string, string1))) { row++; label = gtk_label_new (e_contact_pretty_name(field)); - hbox = gtk_hbox_new (FALSE, 0); + hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX(hbox), (GtkWidget*)label, FALSE, FALSE, 0); - gtk_table_attach_defaults (table, (GtkWidget *)hbox, 0, 1, row, row + 1); + gtk_table_attach_defaults (table, (GtkWidget *)hbox, 0, 1, row, row + 1); data = g_new0 (dropdown_data, 1); - dropdown = gtk_combo_box_new_text(); + dropdown = gtk_combo_box_new_text(); gtk_combo_box_append_text (GTK_COMBO_BOX (dropdown), string); e_contact_set (lookup->match, field, string); if (string1 && *string1) gtk_combo_box_append_text (GTK_COMBO_BOX (dropdown), string1); - else + else gtk_combo_box_append_text (GTK_COMBO_BOX (dropdown), ""); - gtk_combo_box_set_active (GTK_COMBO_BOX (dropdown), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (dropdown), 0); data->field = field; data->match = lookup->match; @@ -322,20 +322,20 @@ mergeit (EContactMergingLookup *lookup) gtk_box_pack_start (GTK_BOX(hbox), (GtkWidget*)dropdown, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *)hbox, 1, 2, row, row + 1); gtk_widget_show_all ((GtkWidget *)dropdown); - } + } } } gtk_window_set_default_size (GTK_WINDOW (dialog), 420, 300); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), GTK_WIDGET (table)); - gtk_box_pack_start (GTK_BOX (dialog->vbox), GTK_WIDGET (scrolled_window), TRUE, TRUE, 0); - gtk_widget_show (scrolled_window); - g_signal_connect (dialog, "map-event", G_CALLBACK (dialog_map), table); + gtk_box_pack_start (GTK_BOX (dialog->vbox), GTK_WIDGET (scrolled_window), TRUE, TRUE, 0); + gtk_widget_show (scrolled_window); + g_signal_connect (dialog, "map-event", G_CALLBACK (dialog_map), table); gtk_widget_show_all ((GtkWidget *)table); result = gtk_dialog_run (dialog); switch (result) - { + { case GTK_RESPONSE_OK: lookup->contact = lookup->match; e_book_async_remove_contact (lookup->book, lookup->match, NULL, lookup); @@ -344,7 +344,7 @@ mergeit (EContactMergingLookup *lookup) break; case GTK_RESPONSE_CANCEL: value = 0; - break; + break; } gtk_widget_destroy (GTK_WIDGET (dialog)); g_list_free (email_attr_list); @@ -353,17 +353,17 @@ mergeit (EContactMergingLookup *lookup) static gboolean check_if_same (EContact *contact, EContact *match) -{ +{ EContactField field; GList *email_attr_list; int num_of_email; - char *str = NULL, *string = NULL, *string1 = NULL; + char *str = NULL, *string = NULL, *string1 = NULL; for(field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1) ; field++) { email_attr_list = e_contact_get_attributes (match, E_CONTACT_EMAIL); num_of_email = g_list_length (email_attr_list); - if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 + if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email<4)) { str = (char *)e_contact_get_const (contact, field); switch(num_of_email) @@ -374,17 +374,17 @@ check_if_same (EContact *contact, EContact *match) if((str && *str) && (g_ascii_strcasecmp(e_contact_get_const (match, E_CONTACT_EMAIL_1),str))) return FALSE; case 2: - if((str && *str) && (g_ascii_strcasecmp(str,e_contact_get_const (match, E_CONTACT_EMAIL_1))) && + if((str && *str) && (g_ascii_strcasecmp(str,e_contact_get_const (match, E_CONTACT_EMAIL_1))) && (g_ascii_strcasecmp(e_contact_get_const (match, E_CONTACT_EMAIL_2),str))) return FALSE; case 3: - if((str && *str) && (g_ascii_strcasecmp(e_contact_get_const (match, E_CONTACT_EMAIL_1),str)) && + if((str && *str) && (g_ascii_strcasecmp(e_contact_get_const (match, E_CONTACT_EMAIL_1),str)) && (g_ascii_strcasecmp(e_contact_get_const (match, E_CONTACT_EMAIL_2),str)) && (g_ascii_strcasecmp(e_contact_get_const (match, E_CONTACT_EMAIL_3),str))) return FALSE; } } - else { + else { string = (char *)e_contact_get_const (contact, field); string1 = (char *)e_contact_get_const (match, field); if ((string && *string) && (string1 && *string1) && (g_ascii_strcasecmp(string1,string))) |