aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEspen Wiborg <espenhw@grumblesmurf.org>2011-09-01 12:05:17 -0500
committerTed Gould <ted@gould.cx>2011-09-01 12:05:17 -0500
commit1ab5a36d28ea2d3bac39534de9c18a95bfcb0670 (patch)
tree2bd4705a11e764c3394c8592a793a356c5364970 /src
parenta748ceb9f10a46400f700d1b4ea2ec5f4b0e1376 (diff)
downloadayatana-indicator-datetime-1ab5a36d28ea2d3bac39534de9c18a95bfcb0670.tar.gz
ayatana-indicator-datetime-1ab5a36d28ea2d3bac39534de9c18a95bfcb0670.tar.bz2
ayatana-indicator-datetime-1ab5a36d28ea2d3bac39534de9c18a95bfcb0670.zip
Set default timezone on events
Diffstat (limited to 'src')
-rw-r--r--src/datetime-service.c12
1 files changed, 12 insertions, 0 deletions
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);