aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2004-12-22 01:25:09 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2004-12-22 01:25:09 +0800
commitc0a76486a4df4f5ddde4d601e92773013e94373b (patch)
tree982d4976ff9556301fd34efa2b4f91ff393c783b /calendar/gui
parent5b3791bb89c449b143691a7cb79ea89549adeff1 (diff)
downloadgsoc2013-evolution-c0a76486a4df4f5ddde4d601e92773013e94373b.tar.gz
gsoc2013-evolution-c0a76486a4df4f5ddde4d601e92773013e94373b.tar.zst
gsoc2013-evolution-c0a76486a4df4f5ddde4d601e92773013e94373b.zip
no need to convert times now. (add_instance_cb): no need to convert here.
2004-12-21 Rodrigo Moya <rodrigo@novell.com> * gui/e-cal-model.c (set_instance_times): no need to convert times now. (add_instance_cb): no need to convert here. svn path=/trunk/; revision=28167
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-cal-model.c47
1 files changed, 18 insertions, 29 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index ff48c6bd4d..04a7f37b23 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1274,7 +1274,6 @@ add_instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end
ECalModelComponent *comp_data;
ECalModelPrivate *priv;
RecurrenceExpansionData *rdata = user_data;
- struct icaltimetype itt;
priv = rdata->model->priv;
@@ -1283,18 +1282,8 @@ add_instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end
comp_data = g_new0 (ECalModelComponent, 1);
comp_data->client = g_object_ref (rdata->client);
comp_data->icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
- if (priv->zone) {
- itt = icaltime_from_timet_with_zone (instance_start, FALSE, icaltimezone_get_utc_timezone ());
- icaltimezone_convert_time (&itt, icaltimezone_get_utc_timezone (), priv->zone);
- comp_data->instance_start = icaltime_as_timet (itt);
-
- itt = icaltime_from_timet_with_zone (instance_end, FALSE, icaltimezone_get_utc_timezone ());
- icaltimezone_convert_time (&itt, icaltimezone_get_utc_timezone (), priv->zone);
- comp_data->instance_end = icaltime_as_timet (itt);
- } else {
- comp_data->instance_start = instance_start;
- comp_data->instance_end = instance_end;
- }
+ comp_data->instance_start = instance_start;
+ comp_data->instance_end = instance_end;
comp_data->dtstart = comp_data->dtend = comp_data->due = comp_data->completed = NULL;
comp_data->color = NULL;
@@ -1315,27 +1304,27 @@ set_instance_times (ECalModelComponent *comp_data, icaltimezone *zone)
if (zone) {
if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
- icaltimezone_convert_time (&recur_time, icaltimezone_get_utc_timezone (), zone);
- comp_data->instance_start = icaltime_as_timet_with_zone (recur_time, zone);
+ comp_data->instance_start = icaltime_as_timet (recur_time);
comp_data->instance_end = comp_data->instance_start +
- (icaltime_as_timet_with_zone (end_time, zone) -
- icaltime_as_timet_with_zone (start_time, zone));
+ (icaltime_as_timet (end_time) -
+ icaltime_as_timet (start_time));
} else {
- icaltimezone_convert_time (&start_time,
- start_time.zone ? start_time.zone : icaltimezone_get_utc_timezone (),
- zone);
- comp_data->instance_start = icaltime_as_timet_with_zone (start_time, zone);
-
- icaltimezone_convert_time (&end_time,
- end_time.zone ? end_time.zone : icaltimezone_get_utc_timezone (),
- zone);
- comp_data->instance_end = icaltime_as_timet_with_zone (end_time, zone);
+ if (start_time.zone) {
+ icaltimezone_convert_time (&start_time, start_time.zone, zone);
+ comp_data->instance_start = icaltime_as_timet (start_time);
+ } else
+ comp_data->instance_start = icaltime_as_timet_with_zone (start_time, zone);
+
+ if (end_time.zone) {
+ icaltimezone_convert_time (&end_time, end_time.zone, zone);
+ comp_data->instance_end = icaltime_as_timet (end_time);
+ } else
+ comp_data->instance_end = icaltime_as_timet_with_zone (end_time, zone);
}
} else {
if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
- icaltimezone_convert_time (&recur_time, icaltimezone_get_utc_timezone (), zone);
- comp_data->instance_start = icaltime_as_timet_with_zone (recur_time, zone);
+ 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));
@@ -1755,8 +1744,8 @@ e_cal_model_set_time_range (ECalModel *model, time_t start, time_t end)
priv->start = start;
priv->end = end;
- g_signal_emit (G_OBJECT (model), signals[TIME_RANGE_CHANGED], 0, start, end);
redo_queries (model);
+ g_signal_emit (G_OBJECT (model), signals[TIME_RANGE_CHANGED], 0, start, end);
}
const char *