[gnome-calendar] manager: pass correct rid & uid to remove-event



commit 6b31ac88c249c9413e6cac97242a18fca55cd087
Author: Yash Singh <yashdev10p gmail com>
Date:   Sat Jun 10 01:47:21 2017 +0530

    manager: pass correct rid & uid to remove-event
    
    Passing the correct rid & uid to
    e_cal_client_remove_object() ensures that
    the deletion of recurrent events is
    handled correctly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782755

 src/gcal-manager.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index b49ae75..b3871e8 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -1801,8 +1801,9 @@ gcal_manager_remove_event (GcalManager    *manager,
                            ECalObjModType  mod)
 {
   GcalManagerUnit *unit;
-  ECalComponentId *id;
   ECalComponent *component;
+  gchar* rid;
+  gchar* uid;
 
   GCAL_ENTRY;
 
@@ -1811,7 +1812,12 @@ gcal_manager_remove_event (GcalManager    *manager,
 
   component = gcal_event_get_component (event);
   unit = g_hash_table_lookup (manager->clients, gcal_event_get_source (event));
-  id = e_cal_component_get_id (component);
+  rid = NULL;
+
+  e_cal_component_get_uid (component, &uid);
+
+  if (gcal_event_has_recurrence (event))
+    rid = e_cal_component_get_recurid_as_string (component);
 
   /*
    * While we're removing the event, we don't want the component
@@ -1821,14 +1827,14 @@ gcal_manager_remove_event (GcalManager    *manager,
   g_object_ref (component);
 
   e_cal_client_remove_object (unit->client,
-                              id->uid,
-                              id->rid,
+                              uid,
+                              rid,
                               mod,
                               manager->async_ops,
                               on_event_removed,
                               component);
 
-  e_cal_component_free_id (id);
+  g_free (rid);
 
   GCAL_EXIT;
 }


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