diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-09-08 00:31:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-09-08 07:08:54 +0800 |
commit | 3da4948c0fc1f2c21b163f0ec456b2d99c881258 (patch) | |
tree | 479d6153d31e03cb7a65990683b5271402e5ec29 /calendar/gui/dialogs/comp-editor.c | |
parent | 2e5031cb4538b4819e5fce5d717668c3445df80a (diff) | |
download | gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.gz gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.bz2 gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.lz gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.xz gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.zst gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.zip |
Miscellaneous cleanups.
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 62 |
1 files changed, 27 insertions, 35 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 39ca3a81e1..0459e4797a 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -390,12 +390,14 @@ changes_view_ready_cb (GObject *source_object, G_STRFUNC, error->message); g_error_free (error); } - } else if (error) { - if (!g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) && - !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - g_warning ( - "%s: Failed to get view: %s", - G_STRFUNC, error->message); + + } else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_error_free (error); + + } else if (error != NULL) { + g_warning ( + "%s: Failed to get view: %s", + G_STRFUNC, error->message); g_error_free (error); } } @@ -619,7 +621,7 @@ save_comp (CompEditor *editor) gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); - if (error) + if (error != NULL) g_error_free (error); g_free (orig_uid_copy); @@ -1055,35 +1057,23 @@ save_and_close_editor (CompEditor *editor, rid = e_cal_component_get_recurid_as_string (priv->comp); source_type = e_cal_client_get_source_type (priv->cal_client); - if (!e_cal_client_get_object_sync (priv->cal_client, uid, rid, &icalcomp, NULL, &error)) { - if (error != NULL) { - switch (source_type) { - case (E_CAL_CLIENT_SOURCE_TYPE_TASKS): - g_warning ("Unable to retrieve saved component from the task list, returned error was: %s", error->message); - break; - case (E_CAL_CLIENT_SOURCE_TYPE_MEMOS): - g_warning ("Unable to retrieve saved component from the memo list, returned error was: %s", error->message); - break; - case (E_CAL_CLIENT_SOURCE_TYPE_EVENTS): - default: - g_warning ("Unable to retrieve saved component from the calendar, returned error was: %s", error->message); - break; - } - g_clear_error (&error); - } else { - switch (source_type) { - case (E_CAL_CLIENT_SOURCE_TYPE_TASKS): - g_warning ("Unable to retrieve saved component from the task list"); + e_cal_client_get_object_sync ( + priv->cal_client, uid, rid, + &icalcomp, NULL, &error); + if (error != NULL) { + switch (source_type) { + case (E_CAL_CLIENT_SOURCE_TYPE_TASKS): + g_warning ("Unable to retrieve saved component from the task list, returned error was: %s", error->message); + break; + case (E_CAL_CLIENT_SOURCE_TYPE_MEMOS): + g_warning ("Unable to retrieve saved component from the memo list, returned error was: %s", error->message); + break; + case (E_CAL_CLIENT_SOURCE_TYPE_EVENTS): + default: + g_warning ("Unable to retrieve saved component from the calendar, returned error was: %s", error->message); break; - case (E_CAL_CLIENT_SOURCE_TYPE_MEMOS): - g_warning ("Unable to retrieve saved component from the memo list"); - break; - case (E_CAL_CLIENT_SOURCE_TYPE_EVENTS): - default: - g_warning ("Unable to retrieve saved component from the calendar"); - break; - } } + g_clear_error (&error); e_notice ( GTK_WINDOW (editor), GTK_MESSAGE_ERROR, @@ -3438,7 +3428,9 @@ real_send_comp (CompEditor *editor, const gchar *uid = NULL; e_cal_component_get_uid (priv->comp, &uid); - if (e_cal_client_get_object_sync (priv->cal_client, uid, NULL, &icalcomp, NULL, NULL) && icalcomp) { + e_cal_client_get_object_sync ( + priv->cal_client, uid, NULL, &icalcomp, NULL, NULL); + if (icalcomp != NULL) { send_comp = e_cal_component_new (); if (!e_cal_component_set_icalcomponent (send_comp, icalcomp)) { icalcomponent_free (icalcomp); |