[evolution-data-server/gnome-3-32] Miscellaneous changes in ecmb_modify_object_sync()



commit eed33a232aa5d1705ed573883c8f6d8a62f3a94a
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jul 1 17:54:53 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 c7b4f6315..f85ff8355 100644
--- a/src/calendar/libedata-cal/e-cal-meta-backend.c
+++ b/src/calendar/libedata-cal/e-cal-meta-backend.c
@@ -1879,11 +1879,11 @@ ecmb_modify_object_sync (ECalMetaBackend *meta_backend,
                        }
 
                        if (split_icalcomp) {
-                               gchar *new_uid;
+                               gchar *split_uid;
 
-                               new_uid = e_util_generate_uid ();
-                               icalcomponent_set_uid (split_icalcomp, new_uid);
-                               g_free (new_uid);
+                               split_uid = e_util_generate_uid ();
+                               icalcomponent_set_uid (split_icalcomp, split_uid);
+                               g_free (split_uid);
 
                                g_warn_if_fail (e_cal_component_set_icalcomponent (comp, split_icalcomp));
 
@@ -1929,8 +1929,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, id->rid, out_new_comp, 
cancellable, NULL))
-                               *out_new_comp = NULL;
+                       if (!e_cal_cache_get_component (cal_cache, new_uid, id->rid, 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]