diff options
author | Rodrigo Moya <rodrigo@novell.com> | 2005-02-08 21:16:26 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2005-02-08 21:16:26 +0800 |
commit | 66b61d305594ff2fd46602bf32def25c90ab427d (patch) | |
tree | e13ef2faf5052197795d80831de20ee486ca4910 /calendar | |
parent | f1f9e1aee828ce30f6e56244cc61e7d72250ef03 (diff) | |
download | gsoc2013-evolution-66b61d305594ff2fd46602bf32def25c90ab427d.tar.gz 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')
-rw-r--r-- | calendar/ChangeLog | 4 | ||||
-rw-r--r-- | calendar/gui/e-cal-model.c | 37 |
2 files changed, 12 insertions, 29 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index e283d8bd49..a1d6e13364 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,7 @@ +2005-02-08 Rodrigo Moya <rodrigo@novell.com> + + * gui/e-cal-model.c (set_instance_times): set instance times correctly. + 2005-02-07 JP Rosevear <jpr@novell.com> Fixes #61075 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 |