From ae9db3ed236b0c734fd12c8dc8c99764626bf0b8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 1 Jul 2011 00:07:26 -0400 Subject: Coding style and whitespace cleanup. --- calendar/gui/dialogs/copy-source-dialog.c | 35 +++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'calendar/gui/dialogs/copy-source-dialog.c') diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c index 7b75624a56..31e7cef1b5 100644 --- a/calendar/gui/dialogs/copy-source-dialog.c +++ b/calendar/gui/dialogs/copy-source-dialog.c @@ -95,23 +95,27 @@ free_copy_data (CopySourceDialogData *csdd) } static void -dest_source_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +dest_source_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { + ESource *source = E_SOURCE (source_object); CopySourceDialogData *csdd = user_data; EClient *client = NULL; GError *error = NULL; - if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error)) - client = NULL; + e_client_utils_open_new_finish (source, result, &client, &error); - if (!client) { + if (error != NULL) { + g_warn_if_fail (client == NULL); show_error (csdd, _("Could not open destination"), error); - if (error) - g_error_free (error); + g_error_free (error); free_copy_data (csdd); return; } + g_return_if_fail (E_IS_CLIENT (client)); + csdd->dest_client = E_CAL_CLIENT (client); e_client_utils_open_new (csdd->selected_source, csdd->obj_type, FALSE, NULL, @@ -170,26 +174,31 @@ dest_source_opened_cb (GObject *source_object, GAsyncResult *result, gpointer us } static void -orig_source_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +orig_source_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { + ESource *source = E_SOURCE (source_object); CopySourceDialogData *csdd = user_data; EClient *client = NULL; GError *error = NULL; - if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error)) - client = NULL; + e_client_utils_open_new_finish (source, result, &client, &error); - if (!client) { + if (error != NULL) { + g_warn_if_fail (client == NULL); show_error (csdd, _("Could not open source"), error); - if (error) - g_error_free (error); + g_error_free (error); free_copy_data (csdd); return; } + g_return_if_fail (E_IS_CLIENT (client)); + csdd->source_client = E_CAL_CLIENT (client); - e_client_utils_open_new (csdd->selected_source, csdd->obj_type, FALSE, NULL, + e_client_utils_open_new ( + csdd->selected_source, csdd->obj_type, FALSE, NULL, e_client_utils_authenticate_handler, csdd->parent, dest_source_opened_cb, csdd); } -- cgit