diff options
author | Espen Wiborg <espenhw@grumblesmurf.org> | 2011-09-01 12:05:17 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-09-01 12:05:17 -0500 |
commit | 1ab5a36d28ea2d3bac39534de9c18a95bfcb0670 (patch) | |
tree | 2bd4705a11e764c3394c8592a793a356c5364970 /src/datetime-service.c | |
parent | a748ceb9f10a46400f700d1b4ea2ec5f4b0e1376 (diff) | |
download | ayatana-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/datetime-service.c')
-rw-r--r-- | src/datetime-service.c | 12 |
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); |