core/event: Cosmetics

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/663>
This commit is contained in:
Georges Basile Stavracas Neto
2025-11-19 09:48:25 -03:00
parent a884076dc5
commit 50217bba42
+9 -8
View File
@@ -309,8 +309,6 @@ setup_component (GcalEvent *self,
{ {
g_autoptr (GTimeZone) zone_start = NULL; g_autoptr (GTimeZone) zone_start = NULL;
g_autoptr (GDateTime) date_start = NULL; g_autoptr (GDateTime) date_start = NULL;
g_autoptr (GTimeZone) zone_end = NULL;
g_autoptr (GDateTime) date_end = NULL;
ECalComponentDateTime *start; ECalComponentDateTime *start;
ECalComponentDateTime *end; ECalComponentDateTime *end;
ECalComponentText *text; ECalComponentText *text;
@@ -360,13 +358,11 @@ setup_component (GcalEvent *self,
/* Setup end date */ /* Setup end date */
end = e_cal_component_get_dtend (self->component); end = e_cal_component_get_dtend (self->component);
if (!end || !e_cal_component_datetime_get_value (end)) if (end && e_cal_component_datetime_get_value (end))
{
self->all_day = TRUE;
self->dt_end = g_date_time_add_days (self->dt_start, 1);
}
else
{ {
g_autoptr (GTimeZone) zone_end = NULL;
g_autoptr (GDateTime) date_end = NULL;
GCAL_TRACE_MSG ("Retrieving end timezone"); GCAL_TRACE_MSG ("Retrieving end timezone");
date = i_cal_time_normalize (e_cal_component_datetime_get_value (end)); date = i_cal_time_normalize (e_cal_component_datetime_get_value (end));
@@ -387,6 +383,11 @@ setup_component (GcalEvent *self,
g_clear_object (&date); g_clear_object (&date);
} }
else
{
self->all_day = TRUE;
self->dt_end = g_date_time_add_days (self->dt_start, 1);
}
/* Summary */ /* Summary */
text = e_cal_component_get_summary (self->component); text = e_cal_component_get_summary (self->component);