From 91a1042a4aaa980ef8faf96bf63949e0a4bc91f2 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Thu, 11 May 2006 09:35:00 +0000 Subject: partially fixes #332911 svn path=/trunk/; revision=31971 --- calendar/gui/e-cal-model.c | 19 +++++++++++++++++++ calendar/gui/e-calendar-view.c | 23 +++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 3e7a826bc0..51441d8fab 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -2111,6 +2111,25 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, icaltimezone *zon if (start_time.zone) zone = start_time.zone; + else { + icalparameter *param = NULL; + icalproperty *prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY); + + if (prop) { + param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); + + if (param) { + const char *tzid = NULL; + icaltimezone *st_zone = NULL; + + tzid = icalparameter_get_tzid (param); + e_cal_get_timezone (comp_data->client, tzid, &st_zone, NULL); + + if (st_zone) + zone = st_zone; + } + } + } comp_data->instance_start = icaltime_as_timet_with_zone (start_time, zone); diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index f1c7c2d954..2327914576 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -2054,12 +2054,12 @@ tooltip_grab (GtkWidget *tooltip, GdkEventKey *event, ECalendarView *view) } static char * -get_label (struct icaltimetype *tt) +get_label (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone) { char buffer[1000]; struct tm tmp_tm; - tmp_tm = icaltimetype_to_tm (tt); + tmp_tm = icaltimetype_to_tm_with_zone (tt, f_zone, t_zone); e_time_format_date_and_time (&tmp_tm, calendar_config_get_24_hour_format (), FALSE, FALSE, @@ -2129,12 +2129,15 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) GtkStyle *style = gtk_widget_get_default_style (); GtkWidget *widget = (GtkWidget *) g_object_get_data (G_OBJECT (data->cal_view), "tooltip-window"); ECalComponent *newcomp = e_cal_component_new (); - icaltimezone *zone; + icaltimezone *zone, *default_zone; + ECal *client = NULL; /* Delete any stray tooltip if left */ if (widget) gtk_widget_destroy (widget); + client = pevent->comp_data->client; + default_zone = e_calendar_view_get_timezone (data->cal_view); pevent = data->get_view_event (data->cal_view, data->day, data->event_num); clone_comp = icalcomponent_new_clone (pevent->comp_data->icalcomp); @@ -2211,19 +2214,19 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) if (dtstart.tzid) { zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (newcomp), dtstart.tzid); - } else { - zone = NULL; - } - t_start = icaltime_as_timet_with_zone (*dtstart.value, zone); + if (!zone) + e_cal_get_timezone (client, dtstart.tzid, &zone, NULL); + + if (!zone) + zone = default_zone; - if (dtend.tzid) { - zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (newcomp), dtend.tzid); } else { zone = NULL; } + t_start = icaltime_as_timet_with_zone (*dtstart.value, zone); t_end = icaltime_as_timet_with_zone (*dtend.value, zone); - tmp1 = get_label(dtstart.value); + tmp1 = get_label(dtstart.value, zone, default_zone); tmp = calculate_time (t_start, t_end); /* To Translators: It will display "Time: ActualStartDateAndTime (DurationOfTheMeeting)"*/ -- cgit v1.2.3