[evolution-data-server] libecal: e_cal_remove_object() must remove *all* recurrences
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] libecal: e_cal_remove_object() must remove *all* recurrences
- Date: Wed, 10 Aug 2011 16:08:39 +0000 (UTC)
commit 272cb7d5ef42a0c1acb72fd3a0fba2bf53f959c8
Author: Patrick Ohly <patrick ohly intel com>
Date: Tue Aug 9 11:30:14 2011 +0300
libecal: e_cal_remove_object() must remove *all* recurrences
Traditionally, e_cal_remove_object() has always removed all
recurrences, despite the use of MOD_THIS underneath. That was due to
the uncertain semantic of MOD_THIS without rid.
Since clarifying that semantic and fixing the (file) backend
accordingly, e_cal_remove_object() started to behave differently: of
an event series with detached recurrences, only the parent event was
removed, which then caused the failures fixed by the previous commits.
This commit fixes that by switching to MOD_ALL, which properly
reflects the semantic of the API call. It was tested successfully with
the file backend.
calendar/libecal/e-cal-client.c | 2 +-
calendar/libecal/e-cal.c | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/calendar/libecal/e-cal-client.c b/calendar/libecal/e-cal-client.c
index 57da35a..3a1baf5 100644
--- a/calendar/libecal/e-cal-client.c
+++ b/calendar/libecal/e-cal-client.c
@@ -3495,7 +3495,7 @@ e_cal_client_modify_object_sync (ECalClient *client, /* const */ icalcomponent *
* This function allows the removal of instances of a recurrent
* appointment. By using a combination of the @uid, @rid and @mod
* arguments, you can remove specific instances. If what you want
- * is to remove all instances, use #NULL @rid and CALOBJ_MODE_THIS
+ * is to remove all instances, use #NULL @rid and CALOBJ_MOD_ALL
* for the @mod.
*
* The call is finished by e_cal_client_remove_object_finish() from
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index 936397a..e742191 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -3995,13 +3995,14 @@ e_cal_remove_object_with_mod (ECal *ecal, const gchar *uid,
* @uid: Unique identifier of the calendar component to remove.
* @error: Placeholder for error information.
*
- * Asks a calendar to remove a component. If the server is able to remove the
- * component, all clients will be notified and they will emit the "obj_removed"
- * signal.
+ * Asks a calendar to remove all components with the given UID.
+ * If more control of the removal is desired, then use e_cal_remove_object_with_mod().
+ * If the server is able to remove the component(s), all clients will
+ * be notified and they will emit the "obj_removed" signal.
*
* Returns: %TRUE if successful, %FALSE otherwise.
*
- * Deprecated: 3.2: Use e_cal_client_remove_object_sync() instead, with rid set to NULL and mod set to CALOBJ_MOD_THIS.
+ * Deprecated: 3.2: Use e_cal_client_remove_object_sync() instead, with rid set to NULL and mod set to CALOBJ_MOD_ALL.
**/
gboolean
e_cal_remove_object (ECal *ecal, const gchar *uid, GError **error)
@@ -4009,7 +4010,7 @@ e_cal_remove_object (ECal *ecal, const gchar *uid, GError **error)
e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
e_return_error_if_fail (uid, E_CALENDAR_STATUS_INVALID_ARG);
- return e_cal_remove_object_with_mod (ecal, uid, NULL, CALOBJ_MOD_THIS, error);
+ return e_cal_remove_object_with_mod (ecal, uid, NULL, CALOBJ_MOD_ALL, error);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]