aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/copy-source-dialog.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 /calendar/gui/dialogs/copy-source-dialog.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 'calendar/gui/dialogs/copy-source-dialog.c')
-rw-r--r--calendar/gui/dialogs/copy-source-dialog.c35
1 files changed, 22 insertions, 13 deletions
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);
}