aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2006-05-11 17:35:00 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2006-05-11 17:35:00 +0800
commit91a1042a4aaa980ef8faf96bf63949e0a4bc91f2 (patch)
tree4431115bb20be235d05273522eb7d3965d786b8b /calendar/gui
parentc161c47d1ef22ad1ec1cc7089e6830595e8f090c (diff)
downloadgsoc2013-evolution-91a1042a4aaa980ef8faf96bf63949e0a4bc91f2.tar.gz
gsoc2013-evolution-91a1042a4aaa980ef8faf96bf63949e0a4bc91f2.tar.zst
gsoc2013-evolution-91a1042a4aaa980ef8faf96bf63949e0a4bc91f2.zip
partially fixes #332911
svn path=/trunk/; revision=31971
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-cal-model.c19
-rw-r--r--calendar/gui/e-calendar-view.c23
2 files changed, 32 insertions, 10 deletions
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)"*/