timeline: Handle multiday events in calculate_changed_events

This patch do not sends ADD_EVENT for events that are multiday and are
part of the old_range when calling calculate_changed_events. This will
prevent multiday duplicate events to appear in the agenda widget when
using the week view.

If the event is a multiday and it was in the previous range, it won't
send the REMOVE_EVENT so multiday events won't dissapear when it's still
relevant.

See https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/898#note_1602391
This commit is contained in:
Daniel Garcia Moreno
2024-07-09 19:59:42 +00:00
committed by Georges Basile Stavracas Neto
parent d7bbda4eaa
commit c7875f03ff
3 changed files with 27 additions and 0 deletions
+18
View File
@@ -1929,3 +1929,21 @@ gcal_event_format_date (GcalEvent *self)
return g_steal_pointer (&formatted_string);
}
/**
* gcal_event_overlaps:
* @self: a #GcalEvent
* @range: a #GcalRange
*
* Returns: True if the event range overlaps the @range
*/
gboolean
gcal_event_overlaps (GcalEvent *self,
GcalRange *range)
{
GcalRangeOverlap overlap;
g_return_val_if_fail (GCAL_IS_EVENT (self), FALSE);
overlap = gcal_range_calculate_overlap (gcal_event_get_range (self), range, NULL);
return overlap != GCAL_RANGE_NO_OVERLAP;
}