aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-component-preview.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-cal-component-preview.c')
-rw-r--r--calendar/gui/e-cal-component-preview.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c
index 0647f9bcab..ffaba3f84b 100644
--- a/calendar/gui/e-cal-component-preview.c
+++ b/calendar/gui/e-cal-component-preview.c
@@ -164,22 +164,19 @@ timet_to_str_with_zone (ECalComponentDateTime *dt,
gboolean use_24_hour_format)
{
struct icaltimetype itt;
- icaltimezone *zone;
+ icaltimezone *zone = NULL;
struct tm tm;
gchar buf[256];
- if (dt->tzid) {
- /* If we can't find the zone, we'll guess its "local" */
- if (!e_cal_client_get_timezone_sync (client, dt->tzid, &zone, NULL, NULL))
- zone = NULL;
+ if (dt->tzid != NULL) {
+ e_cal_client_get_timezone_sync (
+ client, dt->tzid, &zone, NULL, NULL);
} else if (dt->value->is_utc) {
zone = icaltimezone_get_utc_timezone ();
- } else {
- zone = NULL;
}
itt = *dt->value;
- if (zone)
+ if (zone != NULL)
icaltimezone_convert_time (&itt, zone, default_zone);
tm = icaltimetype_to_tm (&itt);