From 1ab5a36d28ea2d3bac39534de9c18a95bfcb0670 Mon Sep 17 00:00:00 2001 From: Espen Wiborg Date: Thu, 1 Sep 2011 12:05:17 -0500 Subject: Set default timezone on events --- src/datetime-service.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/datetime-service.c b/src/datetime-service.c index 57a726c..80c0b57 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -770,6 +770,18 @@ update_appointment_menu_items (gpointer user_data) ECal *ecal = e_cal_new(source, E_CAL_SOURCE_TYPE_EVENT); e_cal_set_auth_func (ecal, (ECalAuthFunc) auth_func, NULL); + icaltimezone* current_zone = icaltimezone_get_builtin_timezone(current_timezone); + if (!current_zone) { + // current_timezone may be a TZID? + current_zone = icaltimezone_get_builtin_timezone_from_tzid(current_timezone); + } + if (current_zone && !e_cal_set_default_timezone(ecal, current_zone, &gerror)) { + g_debug("Failed to set ecal default timezone %s", gerror->message); + g_error_free(gerror); + gerror = NULL; + continue; + } + if (!e_cal_open(ecal, FALSE, &gerror)) { g_debug("Failed to get ecal sources %s", gerror->message); g_error_free(gerror); -- cgit v1.2.3