[evolution] Bug 780934 - Component not moved when changing calendar in editor



commit 2493350ade4b0da2285be6b92140025f66364a61
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 30 12:55:03 2017 +0200

    Bug 780934 - Component not moved when changing calendar in editor

 src/calendar/gui/e-comp-editor.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/calendar/gui/e-comp-editor.c b/src/calendar/gui/e-comp-editor.c
index 7fa78c2..c6e7703 100644
--- a/src/calendar/gui/e-comp-editor.c
+++ b/src/calendar/gui/e-comp-editor.c
@@ -803,7 +803,7 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
 {
        SaveData *sd = user_data;
        const gchar *create_alert_ident, *modify_alert_ident, *remove_alert_ident, *get_alert_ident;
-       gchar *orig_uid;
+       gchar *orig_uid, *new_uid = NULL;
 
        g_return_if_fail (sd != NULL);
        g_return_if_fail (E_IS_CAL_CLIENT (sd->target_client));
@@ -875,18 +875,12 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
 
                g_clear_object (&comp);
        } else {
-               gchar *uid = NULL;
-
                e_alert_sink_thread_job_set_alert_ident (job_data, create_alert_ident);
 
-               sd->success = e_cal_client_create_object_sync (sd->target_client, sd->component, &uid, 
cancellable, error);
-
-               if (sd->success) {
-                       icalcomponent_set_uid (sd->component, uid);
-                       g_free (uid);
+               sd->success = e_cal_client_create_object_sync (sd->target_client, sd->component, &new_uid, 
cancellable, error);
 
+               if (sd->success)
                        sd->object_created = TRUE;
-               }
        }
 
        if (sd->success && sd->source_client &&
@@ -917,6 +911,11 @@ ece_save_component_thread (EAlertSinkThreadJobData *job_data,
                }
        }
 
+       if (new_uid) {
+               icalcomponent_set_uid (sd->component, new_uid);
+               g_free (new_uid);
+       }
+
        g_free (orig_uid);
 
        if (sd->success && !sd->close_after_save) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]