From 50217bba4249ba59c36a16e67d92dfd60dfa4262 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 19 Nov 2025 09:48:25 -0300 Subject: [PATCH] core/event: Cosmetics Part-of: --- src/core/gcal-event.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/gcal-event.c b/src/core/gcal-event.c index 9e86f14e..7cec2766 100644 --- a/src/core/gcal-event.c +++ b/src/core/gcal-event.c @@ -309,8 +309,6 @@ setup_component (GcalEvent *self, { g_autoptr (GTimeZone) zone_start = NULL; g_autoptr (GDateTime) date_start = NULL; - g_autoptr (GTimeZone) zone_end = NULL; - g_autoptr (GDateTime) date_end = NULL; ECalComponentDateTime *start; ECalComponentDateTime *end; ECalComponentText *text; @@ -360,13 +358,11 @@ setup_component (GcalEvent *self, /* Setup end date */ end = e_cal_component_get_dtend (self->component); - 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 + if (end && e_cal_component_datetime_get_value (end)) { + g_autoptr (GTimeZone) zone_end = NULL; + g_autoptr (GDateTime) date_end = NULL; + GCAL_TRACE_MSG ("Retrieving end timezone"); date = i_cal_time_normalize (e_cal_component_datetime_get_value (end)); @@ -387,6 +383,11 @@ setup_component (GcalEvent *self, g_clear_object (&date); } + else + { + self->all_day = TRUE; + self->dt_end = g_date_time_add_days (self->dt_start, 1); + } /* Summary */ text = e_cal_component_get_summary (self->component);