aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-07-27 00:32:33 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-07-27 00:32:33 +0800
commite40b1868be45996f361fce9c1ea30dacd03306b2 (patch)
tree0463640cbb4c87e65c99c78ab80038e5b03768d0 /calendar/gui/e-day-view.c
parent6651d98ae36bc2565d5d6bb6914dc397278e00fd (diff)
downloadgsoc2013-evolution-e40b1868be45996f361fce9c1ea30dacd03306b2.tar.gz
gsoc2013-evolution-e40b1868be45996f361fce9c1ea30dacd03306b2.tar.zst
gsoc2013-evolution-e40b1868be45996f361fce9c1ea30dacd03306b2.zip
new function for adding VTIMEZONE components to a VCALENDAR component.
2002-07-26 Rodrigo Moya <rodrigo@ximian.com> * cal-util/cal-util.[ch] (cal_util_add_timezones_from_component): new function for adding VTIMEZONE components to a VCALENDAR component. * gui/e-calendar-table.c (copy_row_cb): added VTIMEZONE components to resulting VCALENDAR top-level component. * gui/e-week-view.c (e_week_view_copy_clipboard): copy to the clipboard a top-level VCALENDAR component, with all the needed VTIMEZONE components. (e_week_view_on_copy): likewise. * gui/e-day-view.c (e_day_view_copy_clipboard): likewise. (e_day_view_on_copy): likewise. svn path=/trunk/; revision=17604
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 378de58323..c73b969731 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -2769,6 +2769,8 @@ e_day_view_copy_clipboard (EDayView *day_view)
{
EDayViewEvent *event;
char *comp_str;
+ icalcomponent *vcal_comp;
+ icalcomponent *new_icalcomp;
g_return_if_fail (E_IS_DAY_VIEW (day_view));
@@ -2776,11 +2778,21 @@ e_day_view_copy_clipboard (EDayView *day_view)
if (event == NULL)
return;
- comp_str = cal_component_get_as_string (event->comp);
+ /* create top-level VCALENDAR component and add VTIMEZONE's */
+ vcal_comp = cal_util_new_top_level ();
+ cal_util_add_timezones_from_component (vcal_comp, event->comp);
+
+ new_icalcomp = icalcomponent_new_clone (cal_component_get_icalcomponent (event->comp));
+ icalcomponent_add_component (vcal_comp, new_icalcomp);
+
+ comp_str = icalcomponent_as_ical_string (vcal_comp);
if (day_view->clipboard_selection != NULL)
g_free (day_view->clipboard_selection);
- day_view->clipboard_selection = comp_str;
+ day_view->clipboard_selection = g_strdup (comp_str);
gtk_selection_owner_set (day_view->invisible, clipboard_atom, GDK_CURRENT_TIME);
+
+ /* free memory */
+ icalcomponent_free (vcal_comp);
}
void
@@ -4133,6 +4145,8 @@ e_day_view_on_copy (GtkWidget *widget, gpointer data)
EDayView *day_view;
EDayViewEvent *event;
char *comp_str;
+ icalcomponent *vcal_comp;
+ icalcomponent *new_icalcomp;
day_view = E_DAY_VIEW (data);
@@ -4140,12 +4154,22 @@ e_day_view_on_copy (GtkWidget *widget, gpointer data)
if (event == NULL)
return;
- comp_str = cal_component_get_as_string (event->comp);
+ /* create top-level VCALENDAR component and add VTIMEZONE's */
+ vcal_comp = cal_util_new_top_level ();
+ cal_util_add_timezones_from_component (vcal_comp, event->comp);
+
+ new_icalcomp = icalcomponent_new_clone (cal_component_get_icalcomponent (event->comp));
+ icalcomponent_add_component (vcal_comp, new_icalcomp);
+
+ comp_str = icalcomponent_as_ical_string (vcal_comp);
if (day_view->clipboard_selection)
g_free (day_view->clipboard_selection);
- day_view->clipboard_selection = comp_str;
+ day_view->clipboard_selection = g_strdup (comp_str);
gtk_selection_owner_set (day_view->invisible, clipboard_atom, GDK_CURRENT_TIME);
+
+ /* free memory */
+ icalcomponent_free (vcal_comp);
}
static void