diff options
Diffstat (limited to 'addressbook/gui/merging')
-rw-r--r-- | addressbook/gui/merging/eab-contact-compare.c | 3 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-compare.h | 62 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-merging.c | 20 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-merging.h | 15 |
4 files changed, 74 insertions, 26 deletions
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index a25ad4e403..231a14281c 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -834,7 +834,8 @@ eab_contact_locate_match_full (EBookClient *book_client, source = e_source_list_peek_default_source (info->source_list); - e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, e_client_utils_authenticate_handler, NULL, book_loaded_cb, info); } diff --git a/addressbook/gui/merging/eab-contact-compare.h b/addressbook/gui/merging/eab-contact-compare.h index 7ce31eddb9..8c07a56f08 100644 --- a/addressbook/gui/merging/eab-contact-compare.h +++ b/addressbook/gui/merging/eab-contact-compare.h @@ -26,8 +26,8 @@ #ifndef __EAB_CONTACT_COMPARE_H__ #define __EAB_CONTACT_COMPARE_H__ -#include <libebook/e-book-client.h> #include <libebook/e-contact.h> +#include <libebook/e-book-client.h> typedef enum { EAB_CONTACT_MATCH_NOT_APPLICABLE = 0, @@ -45,26 +45,56 @@ typedef enum { EAB_CONTACT_MATCH_PART_FAMILY_NAME = 1 << 3 } EABContactMatchPart; -typedef void (*EABContactMatchQueryCallback) (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure); +typedef void (*EABContactMatchQueryCallback) (EContact *contact, + EContact *match, + EABContactMatchType type, + gpointer closure); -EABContactMatchType eab_contact_compare_name_to_string (EContact *contact, const gchar *str); +EABContactMatchType + eab_contact_compare_name_to_string + (EContact *contact, + const gchar *str); -EABContactMatchType eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, - gboolean allow_partial_matches, - gint *matched_parts, EABContactMatchPart *first_matched_part, - gint *matched_character_count); +EABContactMatchType + eab_contact_compare_name_to_string_full + (EContact *contact, + const gchar *str, + gboolean allow_partial_matches, + gint *matched_parts, + EABContactMatchPart *first_matched_part, + gint *matched_character_count); -EABContactMatchType eab_contact_compare_file_as (EContact *contact1, EContact *contact2); -EABContactMatchType eab_contact_compare_name (EContact *contact1, EContact *contact2); -EABContactMatchType eab_contact_compare_nickname (EContact *contact1, EContact *contact2); -EABContactMatchType eab_contact_compare_email (EContact *contact1, EContact *contact2); -EABContactMatchType eab_contact_compare_address (EContact *contact1, EContact *contact2); -EABContactMatchType eab_contact_compare_telephone (EContact *contact1, EContact *contact2); +EABContactMatchType + eab_contact_compare_file_as (EContact *contact1, + EContact *contact2); +EABContactMatchType + eab_contact_compare_name (EContact *contact1, + EContact *contact2); +EABContactMatchType + eab_contact_compare_nickname (EContact *contact1, + EContact *contact2); +EABContactMatchType + eab_contact_compare_email (EContact *contact1, + EContact *contact2); +EABContactMatchType + eab_contact_compare_address (EContact *contact1, + EContact *contact2); +EABContactMatchType + eab_contact_compare_telephone (EContact *contact1, + EContact *contact2); -EABContactMatchType eab_contact_compare (EContact *contact1, EContact *contact2); +EABContactMatchType + eab_contact_compare (EContact *contact1, + EContact *contact2); -void eab_contact_locate_match (EContact *contact, EABContactMatchQueryCallback cb, gpointer closure); -void eab_contact_locate_match_full (EBookClient *book_client, EContact *contact, GList *avoid, EABContactMatchQueryCallback cb, gpointer closure); +void eab_contact_locate_match (EContact *contact, + EABContactMatchQueryCallback cb, + gpointer closure); +void eab_contact_locate_match_full (EBookClient *book_client, + EContact *contact, + GList *avoid, + EABContactMatchQueryCallback cb, + gpointer closure); #endif /* __E_CONTACT_COMPARE_H__ */ diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index f791eab114..1e70b97d77 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -73,7 +73,10 @@ add_lookup (EContactMergingLookup *lookup) { if (running_merge_requests < SIMULTANEOUS_MERGING_REQUESTS) { running_merge_requests++; - eab_contact_locate_match_full (lookup->book_client, lookup->contact, lookup->avoid, match_query_callback, lookup); + eab_contact_locate_match_full ( + lookup->book_client, + lookup->contact, lookup->avoid, + match_query_callback, lookup); } else { merging_queue = g_list_append (merging_queue, lookup); @@ -97,8 +100,9 @@ finished_lookup (void) running_merge_requests++; eab_contact_locate_match_full ( - lookup->book_client, lookup->contact, - lookup->avoid, match_query_callback, lookup); + lookup->book_client, + lookup->contact, lookup->avoid, + match_query_callback, lookup); } } @@ -138,8 +142,8 @@ final_cb_as_id (EBookClient *book_client, if (lookup->id_cb) lookup->id_cb ( - lookup->book_client, error, - lookup->contact ? + lookup->book_client, + error, lookup->contact ? e_contact_get_const ( lookup->contact, E_CONTACT_UID) : NULL, lookup->closure); @@ -566,7 +570,11 @@ match_query_callback (EContact *contact, if (lookup->op == E_CONTACT_MERGING_FIND) { if (lookup->c_cb) - lookup->c_cb (lookup->book_client, NULL, (gint) type <= (gint) EAB_CONTACT_MATCH_VAGUE ? NULL : match, lookup->closure); + lookup->c_cb ( + lookup->book_client, NULL, + (gint) type <= (gint) + EAB_CONTACT_MATCH_VAGUE ? NULL : match, + lookup->closure); free_lookup (lookup); finished_lookup (); diff --git a/addressbook/gui/merging/eab-contact-merging.h b/addressbook/gui/merging/eab-contact-merging.h index c8e2ddb3ef..a922d6b9fb 100644 --- a/addressbook/gui/merging/eab-contact-merging.h +++ b/addressbook/gui/merging/eab-contact-merging.h @@ -30,9 +30,18 @@ G_BEGIN_DECLS -typedef void (*EABMergingAsyncCallback) (EBookClient *book_client, const GError *error, gpointer closure); -typedef void (*EABMergingIdAsyncCallback) (EBookClient *book_client, const GError *error, const gchar *id, gpointer closure); -typedef void (*EABMergingContactAsyncCallback) (EBookClient *book_client, const GError *error, EContact *contact, gpointer closure); +typedef void (*EABMergingAsyncCallback) (EBookClient *book_client, + const GError *error, + gpointer closure); +typedef void (*EABMergingIdAsyncCallback) (EBookClient *book_client, + const GError *error, + const gchar *id, + gpointer closure); +typedef void (*EABMergingContactAsyncCallback) + (EBookClient *book_client, + const GError *error, + EContact *contact, + gpointer closure); gboolean eab_merging_book_add_contact (EBookClient *book_client, EContact *contact, |