[evolution] I#1014 - Calendar: Correct RRULE's UNTIL value saving
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] I#1014 - Calendar: Correct RRULE's UNTIL value saving
- Date: Wed, 26 Aug 2020 12:13:12 +0000 (UTC)
commit 840b8194a7baa4677865300cb7314eaff4a4d0d2
Author: Milan Crha <mcrha redhat com>
Date: Wed Aug 26 14:12:39 2020 +0200
I#1014 - Calendar: Correct RRULE's UNTIL value saving
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1014
src/calendar/gui/e-calendar-view.c | 3 ++-
src/calendar/gui/e-comp-editor-page-recurrence.c | 4 ++++
src/calendar/gui/e-comp-editor.c | 9 +++++++++
src/calendar/gui/e-comp-editor.h | 4 ++++
4 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/calendar/gui/e-calendar-view.c b/src/calendar/gui/e-calendar-view.c
index c51d3f350b..5b186c29ff 100644
--- a/src/calendar/gui/e-calendar-view.c
+++ b/src/calendar/gui/e-calendar-view.c
@@ -263,7 +263,8 @@ calendar_view_delete_event (ECalendarView *cal_view,
instance_rid = i_cal_time_new_from_timet_with_zone (
event->comp_data->instance_start,
TRUE, zone ? zone : i_cal_timezone_get_utc_timezone ());
- e_cal_util_remove_instances (event->comp_data->icalcomp, instance_rid,
E_CAL_OBJ_MOD_THIS);
+ e_cal_util_remove_instances_ex (event->comp_data->icalcomp, instance_rid,
E_CAL_OBJ_MOD_THIS,
+ e_cal_client_tzlookup_cb, event->comp_data->client);
e_cal_ops_modify_component (model, event->comp_data->client,
event->comp_data->icalcomp,
E_CAL_OBJ_MOD_THIS, E_CAL_OPS_SEND_FLAG_DONT_SEND);
diff --git a/src/calendar/gui/e-comp-editor-page-recurrence.c
b/src/calendar/gui/e-comp-editor-page-recurrence.c
index 6af77a907c..9b7c3c413a 100644
--- a/src/calendar/gui/e-comp-editor-page-recurrence.c
+++ b/src/calendar/gui/e-comp-editor-page-recurrence.c
@@ -1268,6 +1268,7 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
ICalComponent *component)
{
enum ending_type ending_type;
+ ECompEditor *comp_editor;
ICalProperty *prop;
ICalRecurrence *recur;
ICalTime *until;
@@ -1276,6 +1277,7 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
g_return_if_fail (E_IS_COMP_EDITOR_PAGE_RECURRENCE (page_recurrence));
+ comp_editor = e_comp_editor_page_ref_editor (E_COMP_EDITOR_PAGE (page_recurrence));
recur = i_cal_recurrence_new ();
/* Frequency, interval, week start */
@@ -1462,6 +1464,7 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
until = i_cal_time_new_null_time ();
i_cal_time_set_date (until, year, month, day);
i_cal_time_set_is_date (until, 1);
+ e_cal_util_normalize_rrule_until_value (component, until, e_comp_editor_lookup_timezone_cb,
comp_editor);
i_cal_recurrence_set_until (recur, until);
g_clear_object (&until);
@@ -1481,6 +1484,7 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
prop = i_cal_property_new_rrule (recur);
i_cal_component_take_property (component, prop);
+ g_clear_object (&comp_editor);
g_clear_object (&recur);
}
diff --git a/src/calendar/gui/e-comp-editor.c b/src/calendar/gui/e-comp-editor.c
index 84d70876ab..295e137a2f 100644
--- a/src/calendar/gui/e-comp-editor.c
+++ b/src/calendar/gui/e-comp-editor.c
@@ -3588,3 +3588,12 @@ e_comp_editor_lookup_timezone (ECompEditor *comp_editor,
return zone;
}
+
+ICalTimezone *
+e_comp_editor_lookup_timezone_cb (const gchar *tzid,
+ gpointer user_data, /* ECompEditor * */
+ GCancellable *cancellable,
+ GError **error)
+{
+ return e_comp_editor_lookup_timezone (user_data, tzid);
+}
diff --git a/src/calendar/gui/e-comp-editor.h b/src/calendar/gui/e-comp-editor.h
index 06939208ec..8973040bcb 100644
--- a/src/calendar/gui/e-comp-editor.h
+++ b/src/calendar/gui/e-comp-editor.h
@@ -182,6 +182,10 @@ ECompEditor * e_comp_editor_find_existing_for (ESource *origin_source,
const ICalComponent *component);
ICalTimezone * e_comp_editor_lookup_timezone (ECompEditor *comp_editor,
const gchar *tzid);
+ICalTimezone * e_comp_editor_lookup_timezone_cb(const gchar *tzid,
+ gpointer user_data, /* ECompEditor * */
+ GCancellable *cancellable,
+ GError **error);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]