aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2001-11-13 21:20:07 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2001-11-13 21:20:07 +0800
commit1775a03b0999d1a49ddd26c389d3ab2c1909751b (patch)
tree0527667718539dd9a00ce545c02e33c076b7452e /calendar/gui/e-day-view.c
parent7730f3c699fc2e7996a39bd672d989e325609126 (diff)
downloadgsoc2013-evolution-1775a03b0999d1a49ddd26c389d3ab2c1909751b.tar.gz
gsoc2013-evolution-1775a03b0999d1a49ddd26c389d3ab2c1909751b.tar.zst
gsoc2013-evolution-1775a03b0999d1a49ddd26c389d3ab2c1909751b.zip
only change the day, month and year for the start date, for not screwing
2001-11-13 Rodrigo Moya <rodrigo@ximian.com> * gui/e-week-view.c (selection_received): only change the day, month and year for the start date, for not screwing up the start time, which was being set to midnight always (Fixes Ximian #5287) Also, deal correctly with VCALENDAR components * gui/e-day-view.c (selection_received): dela correctly with VCALENDAR components being pasted svn path=/trunk/; revision=14684
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 73729e7cbf..a884aa8ac4 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -7030,7 +7030,6 @@ selection_received (GtkWidget *invisible,
e_day_view_get_selected_time_range (day_view, &dtstart, &dtend);
if (kind == ICAL_VCALENDAR_COMPONENT) {
- int num_found = 0;
icalcomponent_kind child_kind;
icalcomponent *subcomp;
@@ -7041,47 +7040,37 @@ selection_received (GtkWidget *invisible,
if (child_kind == ICAL_VEVENT_COMPONENT ||
child_kind == ICAL_VTODO_COMPONENT ||
child_kind == ICAL_VJOURNAL_COMPONENT) {
- CalComponent *tmp_comp;
-
tt_start = icaltime_as_timet (icalcomponent_get_dtstart (subcomp));
tt_end = icaltime_as_timet (icalcomponent_get_dtend (subcomp));
ic_dur = icaldurationtype_from_int (tt_end - tt_start);
itime = icaltime_from_timet_with_zone (dtstart, FALSE, day_view->zone);
- /* FIXME: Need to set TZID. */
+
icalcomponent_set_dtstart (subcomp, itime);
itime = icaltime_add (itime, ic_dur);
icalcomponent_set_dtend (subcomp, itime);
uid = cal_component_gen_uid ();
- tmp_comp = cal_component_new ();
+ comp = cal_component_new ();
cal_component_set_icalcomponent (
- tmp_comp, icalcomponent_new_clone (subcomp));
- cal_component_set_uid (tmp_comp, uid);
+ comp, icalcomponent_new_clone (subcomp));
+ cal_component_set_uid (comp, uid);
+
+ cal_client_update_object (day_view->client, comp);
free (uid);
- gtk_object_unref (GTK_OBJECT (tmp_comp));
+ gtk_object_unref (GTK_OBJECT (comp));
- num_found++;
}
subcomp = icalcomponent_get_next_component (
icalcomp, ICAL_ANY_COMPONENT);
}
-
- if (num_found) {
- comp = cal_component_new ();
- cal_component_set_icalcomponent (comp, icalcomp);
-
- cal_client_update_object (day_view->client, comp);
-
- gtk_object_unref (GTK_OBJECT (comp));
- }
}
else {
tt_start = icaltime_as_timet (icalcomponent_get_dtstart (icalcomp));
tt_end = icaltime_as_timet (icalcomponent_get_dtend (icalcomp));
ic_dur = icaldurationtype_from_int (tt_end - tt_start);
itime = icaltime_from_timet_with_zone (dtstart, FALSE, day_view->zone);
- /* FIXME: Need to set TZID. */
+
icalcomponent_set_dtstart (icalcomp, itime);
itime = icaltime_add (itime, ic_dur);
icalcomponent_set_dtend (icalcomp, itime);