New function to copy a GcalScheduleValues

These structs are immutable.  Any changes will be made on a copy.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/550>
This commit is contained in:
Federico Mena Quintero
2025-08-27 19:59:17 -03:00
committed by Georges Basile Stavracas Neto
parent 939b60d6b4
commit a4d891aadd
@@ -85,6 +85,18 @@ static void on_end_date_time_changed_cb (GtkWidget
GParamSpec *pspec,
GcalScheduleSection *self);
static GcalScheduleValues *
gcal_schedule_values_copy (const GcalScheduleValues *values)
{
GcalScheduleValues *copy = g_new0 (GcalScheduleValues, 1);
copy->all_day = values->all_day;
copy->date_start = values->date_start ? g_date_time_ref (values->date_start) : NULL;
copy->date_end = values->date_end ? g_date_time_ref (values->date_end) : NULL;
copy->recur = values->recur ? gcal_recurrence_ref (values->recur) : NULL;
return copy;
}
/*
* Auxiliary methods