From 733f748b38e3f7b0c4e7a6293c7226dc8231b411 Mon Sep 17 00:00:00 2001 From: "P. S. Chakravarthi" Date: Wed, 3 Aug 2005 06:03:39 +0000 Subject: Fixes #306017 Obtain the default zone information from cal-view and 2005-08-03 P. S. Chakravarthi Fixes #306017 * gui/e-calendar-view.c: (e_calendar_view_delete_selected_occurrence): Obtain the default zone information from cal-view and eventually use it to determine the correct rid for an all-day event. svn path=/trunk/; revision=29961 --- calendar/ChangeLog | 7 +++++++ calendar/gui/e-calendar-view.c | 25 ++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 480e58699b..46eddb896e 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2005-08-03 P. S. Chakravarthi + + Fixes #306017 + * gui/e-calendar-view.c: (e_calendar_view_delete_selected_occurrence): + Obtain the default zone information from cal-view and eventually use it to + determine the correct rid for an all-day event. + 2005-08-01 Shakti Sen * gui/tasks-control.c (tasks_control_sensitize_commands): Added support diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 88c1743738..c143faa2cd 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -923,7 +923,7 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) ECalComponent *comp; struct icaltimetype itt; ECalComponentDateTime dt; - icaltimezone *zone; + icaltimezone *zone = NULL; selected = e_calendar_view_get_selected_events (cal_view); if (!selected) @@ -936,19 +936,26 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) e_cal_component_get_uid (comp, &uid); e_cal_component_get_dtstart (comp, &dt); - e_cal_get_timezone (event->comp_data->client, dt.tzid, &zone, NULL); - if (!e_cal_get_recurrences_no_master (event->comp_data->client)) { - if (zone) - itt = icaltime_from_timet_with_zone (event->comp_data->instance_start, TRUE, zone); - else - itt = icaltime_from_timet (event->comp_data->instance_start, TRUE); + if (dt.tzid) { + GError *error = NULL; + + e_cal_get_timezone (event->comp_data->client, dt.tzid, &zone, &error); + if (error) { + zone = e_calendar_view_get_timezone (cal_view); + g_clear_error(&error); + } + } else + zone = e_calendar_view_get_timezone (cal_view); + + itt = icaltime_from_timet_with_zone (event->comp_data->instance_start, TRUE, zone ? zone : icaltimezone_get_utc_timezone ()); + + if (!e_cal_get_recurrences_no_master (event->comp_data->client)) rid = icaltime_as_ical_string (itt); - } else + else rid = e_cal_component_get_recurid_as_string (comp); e_cal_component_free_datetime (&dt); - if (rid) { if (delete_component_dialog (comp, FALSE, 1, e_cal_component_get_vtype (comp), GTK_WIDGET (cal_view))) { -- cgit v1.2.3