[evolution-data-server] Miscellaneous changes in ecmb_modify_object_sync()



commit 2a3b89faca73ab44c73cec41738821a7120b7a8a
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 28 09:26:48 2019 +0200

    Miscellaneous changes in ecmb_modify_object_sync()
    
    The first chunk to not clash with top-block variable of the same name.
    The second to always return a new component instance on success.

 src/calendar/libedata-cal/e-cal-meta-backend.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/calendar/libedata-cal/e-cal-meta-backend.c b/src/calendar/libedata-cal/e-cal-meta-backend.c
index 69a0d0c4b..4389ee977 100644
--- a/src/calendar/libedata-cal/e-cal-meta-backend.c
+++ b/src/calendar/libedata-cal/e-cal-meta-backend.c
@@ -1917,11 +1917,11 @@ ecmb_modify_object_sync (ECalMetaBackend *meta_backend,
                        }
 
                        if (split_icomp) {
-                               gchar *new_uid;
+                               gchar *split_uid;
 
-                               new_uid = e_util_generate_uid ();
-                               i_cal_component_set_uid (split_icomp, new_uid);
-                               g_free (new_uid);
+                               split_uid = e_util_generate_uid ();
+                               i_cal_component_set_uid (split_icomp, split_uid);
+                               g_free (split_uid);
 
                                g_warn_if_fail (e_cal_component_set_icalcomponent (comp, split_icomp));
 
@@ -1971,8 +1971,9 @@ ecmb_modify_object_sync (ECalMetaBackend *meta_backend,
                *out_old_comp = old_comp;
        if (out_new_comp) {
                if (new_uid) {
-                       if (!e_cal_cache_get_component (cal_cache, new_uid, e_cal_component_id_get_rid (id), 
out_new_comp, cancellable, NULL))
-                               *out_new_comp = NULL;
+                       if (!e_cal_cache_get_component (cal_cache, new_uid, e_cal_component_id_get_rid (id), 
out_new_comp, cancellable, NULL) &&
+                           !e_cal_cache_get_component (cal_cache, new_uid, NULL, out_new_comp, cancellable, 
NULL))
+                               *out_new_comp = new_comp ? g_object_ref (new_comp) : NULL;
                } else {
                        *out_new_comp = new_comp ? g_object_ref (new_comp) : NULL;
                }


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