From f51186c298560caa76900e448678f02d6622ad77 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 24 Feb 2025 20:59:00 -0600 Subject: [PATCH] gcal_schedule_section_apply(): use the stored values as a reference Also, update the values from the updated event at the end. Part-of: --- src/gui/event-editor/gcal-schedule-section.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/event-editor/gcal-schedule-section.c b/src/gui/event-editor/gcal-schedule-section.c index 98ce0b37..1559188d 100644 --- a/src/gui/event-editor/gcal-schedule-section.c +++ b/src/gui/event-editor/gcal-schedule-section.c @@ -476,7 +476,6 @@ gcal_schedule_section_apply (GcalEventEditorSection *section) GDateTime *start_date, *end_date; GcalRecurrenceFrequency freq; GcalScheduleSection *self; - GcalRecurrence *old_recur; gboolean all_day; GCAL_ENTRY; @@ -524,7 +523,7 @@ gcal_schedule_section_apply (GcalEventEditorSection *section) gcal_event_set_date_end (self->event, end_date); /* Check Repeat popover and set recurrence-rules accordingly */ - old_recur = gcal_event_get_recurrence (self->event); + freq = adw_combo_row_get_selected (ADW_COMBO_ROW (self->repeat_combo)); if (freq != GCAL_RECURRENCE_NO_REPEAT) @@ -541,7 +540,7 @@ gcal_schedule_section_apply (GcalEventEditorSection *section) recur->limit.count = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (self->number_of_occurrences_spin)); /* Only apply the new recurrence if it's different from the old one */ - if (!gcal_recurrence_is_equal (old_recur, recur)) + if (!gcal_recurrence_is_equal (self->values->recur, recur)) { /* Remove the previous recurrence... */ remove_recurrence_properties (self->event); @@ -556,6 +555,9 @@ gcal_schedule_section_apply (GcalEventEditorSection *section) remove_recurrence_properties (self->event); } + gcal_schedule_values_free (self->values); + self->values = gcal_schedule_values_from_event (self->event); + GCAL_EXIT; }