aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/eab-gui-util.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-07-01 12:07:26 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-08-13 23:27:51 +0800
commitf59681796df8fe0138a1754abbe8ec781bc1535e (patch)
tree0ced0c119ffed095713d7f64732686df9b2d9152 /addressbook/gui/widgets/eab-gui-util.c
parentbf4a1a13e3295deefc4031a446627ff9b1c95c7a (diff)
downloadgsoc2013-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/widgets/eab-gui-util.c')
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 7b94c85233..d910b339b4 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -374,7 +374,9 @@ struct ContactCopyProcess_ {
static void process_unref (ContactCopyProcess *process);
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);
ContactCopyProcess *process = user_data;
@@ -382,8 +384,10 @@ remove_contact_ready_cb (GObject *source_object, GAsyncResult *result, gpointer
e_book_client_remove_contact_by_uid_finish (book_client, result, &error);
- if (error) {
- g_debug ("%s: Remove contact by uid failed: %s", G_STRFUNC, error->message);
+ if (error != NULL) {
+ g_warning (
+ "%s: Remove contact by uid failed: %s",
+ G_STRFUNC, error->message);
g_error_free (error);
}
@@ -474,29 +478,33 @@ do_copy (gpointer data, gpointer user_data)
}
static void
-book_loaded_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+book_loaded_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ESource *destination = E_SOURCE (source_object);
ContactCopyProcess *process = user_data;
EClient *client = NULL;
- EBookClient *book_client;
GError *error = NULL;
- if (!e_client_utils_open_new_finish (destination, result, &client, &error))
- client = NULL;
-
- book_client = client ? E_BOOK_CLIENT (client) : NULL;
+ e_client_utils_open_new_finish (destination, result, &client, &error);
- if (book_client != NULL) {
- g_warn_if_fail (error == NULL);
- process->destination = book_client;
- process->book_status = TRUE;
- g_slist_foreach (process->contacts, do_copy, process);
- } else if (error != NULL) {
- g_debug ("%s: Failed to open destination client: %s", G_STRFUNC, error->message);
+ if (error != NULL) {
+ g_warn_if_fail (client == NULL);
+ g_warning (
+ "%s: Failed to open destination client: %s",
+ G_STRFUNC, error->message);
g_error_free (error);
+ goto exit;
}
+ g_return_if_fail (E_IS_CLIENT (client));
+
+ process->destination = E_BOOK_CLIENT (client);
+ process->book_status = TRUE;
+ g_slist_foreach (process->contacts, do_copy, process);
+
+exit:
process_unref (process);
}