diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-07-01 12:07:26 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-08-13 23:27:51 +0800 |
commit | f59681796df8fe0138a1754abbe8ec781bc1535e (patch) | |
tree | 0ced0c119ffed095713d7f64732686df9b2d9152 /addressbook/gui/merging | |
parent | bf4a1a13e3295deefc4031a446627ff9b1c95c7a (diff) | |
download | gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.gz gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.bz2 gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.lz gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.xz gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.zst gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'addressbook/gui/merging')
-rw-r--r-- | addressbook/gui/merging/eab-contact-compare.c | 29 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-merging.c | 46 |
2 files changed, 55 insertions, 20 deletions
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index 8295b77e7e..fd6ad8c012 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -573,7 +573,9 @@ match_search_info_free (MatchSearchInfo *info) } static void -query_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +query_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { MatchSearchInfo *info = (MatchSearchInfo *) user_data; EABContactMatchType best_match = EAB_CONTACT_MATCH_NONE; @@ -584,12 +586,21 @@ query_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) GError *error = NULL; const GSList *ii; - if (result && !e_book_client_get_contacts_finish (book_client, result, &contacts, &error)) { - g_debug ("%s: Failed to get contacts: %s\n", G_STRFUNC, error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + if (result != NULL) + e_book_client_get_contacts_finish ( + book_client, result, &contacts, &error); + + if (error != NULL) { + g_warning ( + "%s: Failed to get contacts: %s\n", + G_STRFUNC, error->message); + g_error_free (error); + + info->cb ( + info->contact, NULL, + EAB_CONTACT_MATCH_NONE, + info->closure); - info->cb (info->contact, NULL, EAB_CONTACT_MATCH_NONE, info->closure); match_search_info_free (info); g_object_unref (book_client); return; @@ -751,10 +762,10 @@ book_loaded_cb (GObject *source_object, MatchSearchInfo *info = user_data; EClient *client = NULL; - if (!e_client_utils_open_new_finish (source, result, &client, NULL)) - client = NULL; + e_client_utils_open_new_finish (source, result, &client, NULL); - use_common_book_client (client ? E_BOOK_CLIENT (client): NULL, info); + /* Client may be NULL; don't use a type cast macro. */ + use_common_book_client ((EBookClient *) client, info); } void diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index 99bb2d39fb..557af481bb 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -96,7 +96,9 @@ finished_lookup (void) merging_queue = g_list_remove_link (merging_queue, merging_queue); 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); } } @@ -112,7 +114,10 @@ free_lookup (EContactMergingLookup *lookup) } static void -final_id_cb (EBookClient *book_client, const GError *error, const gchar *id, gpointer closure) +final_id_cb (EBookClient *book_client, + const GError *error, + const gchar *id, + gpointer closure) { EContactMergingLookup *lookup = closure; @@ -125,12 +130,19 @@ final_id_cb (EBookClient *book_client, const GError *error, const gchar *id, gpo } static void -final_cb_as_id (EBookClient *book_client, const GError *error, gpointer closure) +final_cb_as_id (EBookClient *book_client, + const GError *error, + gpointer closure) { EContactMergingLookup *lookup = closure; if (lookup->id_cb) - lookup->id_cb (lookup->book_client, error, lookup->contact ? e_contact_get_const (lookup->contact, E_CONTACT_UID) : NULL, lookup->closure); + lookup->id_cb ( + lookup->book_client, error, + lookup->contact ? + e_contact_get_const ( + lookup->contact, E_CONTACT_UID) : NULL, + lookup->closure); free_lookup (lookup); @@ -138,7 +150,9 @@ final_cb_as_id (EBookClient *book_client, const GError *error, gpointer closure) } static void -final_cb (EBookClient *book_client, const GError *error, gpointer closure) +final_cb (EBookClient *book_client, + const GError *error, + gpointer closure) { EContactMergingLookup *lookup = closure; @@ -151,7 +165,9 @@ final_cb (EBookClient *book_client, const GError *error, gpointer closure) } static void -modify_contact_ready_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +modify_contact_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { EBookClient *book_client = E_BOOK_CLIENT (source_object); EContactMergingLookup *lookup = user_data; @@ -172,7 +188,9 @@ modify_contact_ready_cb (GObject *source_object, GAsyncResult *result, gpointer } static void -add_contact_ready_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +add_contact_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { EBookClient *book_client = E_BOOK_CLIENT (source_object); EContactMergingLookup *lookup = user_data; @@ -251,7 +269,9 @@ dropdown_changed (GtkWidget *dropdown, dropdown_data *data) } static void -remove_contact_ready_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +remove_contact_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { EBookClient *book_client = E_BOOK_CLIENT (source_object); EContactMergingLookup *lookup = user_data; @@ -262,12 +282,16 @@ remove_contact_ready_cb (GObject *source_object, GAsyncResult *result, gpointer e_book_client_remove_contact_finish (book_client, result, &error); - if (error) { - g_debug ("%s: Failed to remove contact: %s", G_STRFUNC, error->message); + if (error != NULL) { + g_warning ( + "%s: Failed to remove contact: %s", + G_STRFUNC, error->message); g_error_free (error); } - e_book_client_add_contact (book_client, lookup->contact, NULL, add_contact_ready_cb, lookup); + e_book_client_add_contact ( + book_client, lookup->contact, NULL, + add_contact_ready_cb, lookup); } static gint |