diff options
author | James Bottomley <jejbev@hansenpartnership.com> | 2011-08-11 19:46:11 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-08-11 19:46:11 +0800 |
commit | 84b566863ec2c8d462db645b19a871837e85c989 (patch) | |
tree | 09ef0590fcc60771e20f080a5f5d8154d9f986d3 /modules | |
parent | 15376b6657c77d4f701367c4f14bed653201fe26 (diff) | |
download | gsoc2013-evolution-84b566863ec2c8d462db645b19a871837e85c989.tar gsoc2013-evolution-84b566863ec2c8d462db645b19a871837e85c989.tar.gz gsoc2013-evolution-84b566863ec2c8d462db645b19a871837e85c989.tar.bz2 gsoc2013-evolution-84b566863ec2c8d462db645b19a871837e85c989.tar.lz gsoc2013-evolution-84b566863ec2c8d462db645b19a871837e85c989.tar.xz gsoc2013-evolution-84b566863ec2c8d462db645b19a871837e85c989.tar.zst gsoc2013-evolution-84b566863ec2c8d462db645b19a871837e85c989.zip |
Bug #655843 - Copy to calendar doesn't add timezone information
Diffstat (limited to 'modules')
-rw-r--r-- | modules/calendar/e-cal-shell-view-private.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 0ca3f344ec..01ae23cc1c 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -821,6 +821,31 @@ e_cal_shell_view_set_status_message (ECalShellView *cal_shell_view, cal_shell_view->priv->calendar_activity = activity; } +struct ForeachTzidData +{ + ECalClient *source_client; + ECalClient *dest_client; +}; + +static void +add_timezone_to_cal_cb (icalparameter *param, gpointer data) +{ + struct ForeachTzidData *ftd = data; + icaltimezone *tz = NULL; + const gchar *tzid; + + g_return_if_fail (ftd != NULL); + g_return_if_fail (ftd->source_client != NULL); + g_return_if_fail (ftd->dest_client != NULL); + + tzid = icalparameter_get_tzid (param); + if (!tzid || !*tzid) + return; + + if (e_cal_client_get_timezone_sync (ftd->source_client, tzid, &tz, NULL, NULL) && tz) + e_cal_client_add_timezone_sync (ftd->dest_client, tz, NULL, NULL); +} + void e_cal_shell_view_transfer_item_to (ECalShellView *cal_shell_view, ECalendarViewEvent *event, @@ -863,6 +888,10 @@ e_cal_shell_view_transfer_item_to (ECalShellView *cal_shell_view, icalproperty *icalprop; gchar *new_uid; GError *error = NULL; + struct ForeachTzidData ftd; + + ftd.source_client = event->comp_data->client; + ftd.dest_client = destination_client; if (e_cal_util_component_is_instance (icalcomp_event)) { success = e_cal_client_get_object_sync ( @@ -904,6 +933,7 @@ e_cal_shell_view_transfer_item_to (ECalShellView *cal_shell_view, } new_uid = NULL; + icalcomponent_foreach_tzid (icalcomp_clone, add_timezone_to_cal_cb, &ftd); success = e_cal_client_create_object_sync ( destination_client, icalcomp_clone, &new_uid, NULL, &error); if (!success) { |