aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJames Bottomley <jejbev@hansenpartnership.com>2011-08-11 19:46:11 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:48 +0800
commit5a11011d235f01a17b9e47ab60bc07ed754caf20 (patch)
tree666ad9a74530a228b724f3c48cc84dfbf7fb5418 /modules
parent911d9f8c6b947d8ac922489fc03b1d063b377973 (diff)
downloadgsoc2013-evolution-5a11011d235f01a17b9e47ab60bc07ed754caf20.tar
gsoc2013-evolution-5a11011d235f01a17b9e47ab60bc07ed754caf20.tar.gz
gsoc2013-evolution-5a11011d235f01a17b9e47ab60bc07ed754caf20.tar.bz2
gsoc2013-evolution-5a11011d235f01a17b9e47ab60bc07ed754caf20.tar.lz
gsoc2013-evolution-5a11011d235f01a17b9e47ab60bc07ed754caf20.tar.xz
gsoc2013-evolution-5a11011d235f01a17b9e47ab60bc07ed754caf20.tar.zst
gsoc2013-evolution-5a11011d235f01a17b9e47ab60bc07ed754caf20.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.c30
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) {