aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2005-02-08 21:16:26 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2005-02-08 21:16:26 +0800
commit66b61d305594ff2fd46602bf32def25c90ab427d (patch)
treee13ef2faf5052197795d80831de20ee486ca4910 /calendar/gui
parentf1f9e1aee828ce30f6e56244cc61e7d72250ef03 (diff)
downloadgsoc2013-evolution-66b61d305594ff2fd46602bf32def25c90ab427d.tar
gsoc2013-evolution-66b61d305594ff2fd46602bf32def25c90ab427d.tar.gz
gsoc2013-evolution-66b61d305594ff2fd46602bf32def25c90ab427d.tar.bz2
gsoc2013-evolution-66b61d305594ff2fd46602bf32def25c90ab427d.tar.lz
gsoc2013-evolution-66b61d305594ff2fd46602bf32def25c90ab427d.tar.xz
gsoc2013-evolution-66b61d305594ff2fd46602bf32def25c90ab427d.tar.zst
gsoc2013-evolution-66b61d305594ff2fd46602bf32def25c90ab427d.zip
set instance times correctly.
2005-02-08 Rodrigo Moya <rodrigo@novell.com> * gui/e-cal-model.c (set_instance_times): set instance times correctly. svn path=/trunk/; revision=28747
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-cal-model.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 6139b3ee52..7b56219e62 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1295,42 +1295,21 @@ add_instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end
static void
set_instance_times (ECalModelComponent *comp_data, icaltimezone *zone)
{
- struct icaltimetype recur_time, start_time, end_time;
+ struct icaltimetype recur_time, start_time, end_time, itt;
recur_time = icalcomponent_get_recurrenceid (comp_data->icalcomp);
start_time = icalcomponent_get_dtstart (comp_data->icalcomp);
end_time = icalcomponent_get_dtend (comp_data->icalcomp);
- if (zone) {
- if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
- comp_data->instance_start = icaltime_as_timet_with_zone (recur_time,
- start_time.zone ? start_time.zone : zone);
-
- comp_data->instance_end = comp_data->instance_start +
- (icaltime_as_timet_with_zone (end_time, end_time.zone ? end_time.zone : zone) -
- icaltime_as_timet_with_zone (start_time, start_time.zone ? start_time.zone : zone));
- } else {
- if (start_time.zone) {
- comp_data->instance_start = icaltime_as_timet_with_zone (start_time, start_time.zone);
- } else
- comp_data->instance_start = icaltime_as_timet_with_zone (start_time, zone);
-
- if (end_time.zone) {
- comp_data->instance_end = icaltime_as_timet_with_zone (end_time, end_time.zone);
- } else
- comp_data->instance_end = icaltime_as_timet_with_zone (end_time, zone);
- }
+ if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
+ itt = icaltime_convert_to_zone (recur_time, icaltimezone_get_utc_timezone ());
+ comp_data->instance_start = icaltime_as_timet (itt);
} else {
- if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
- comp_data->instance_start = icaltime_as_timet (recur_time);
- comp_data->instance_end = comp_data->instance_start +
- (icaltime_as_timet (end_time) -
- icaltime_as_timet (start_time));
- } else {
- comp_data->instance_start = icaltime_as_timet (icalcomponent_get_dtstart (comp_data->icalcomp));
- comp_data->instance_end = icaltime_as_timet (icalcomponent_get_dtend (comp_data->icalcomp));
- }
+ comp_data->instance_start = icaltime_as_timet (start_time);
}
+
+ comp_data->instance_end = comp_data->instance_start +
+ (icaltime_as_timet (end_time) - icaltime_as_timet (start_time));
}
static void