aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog41
-rw-r--r--calendar/cal-util/cal-recur.c4
-rw-r--r--calendar/cal-util/timeutil.c7
-rw-r--r--calendar/gui/calendar-model.c1
-rw-r--r--calendar/gui/dialogs/event-page.c6
-rw-r--r--calendar/gui/dialogs/recurrence-page.c7
-rw-r--r--calendar/gui/dialogs/task-details-page.c4
-rw-r--r--calendar/gui/dialogs/task-page.c6
-rw-r--r--calendar/gui/e-day-view.c4
-rw-r--r--calendar/gui/e-week-view.c1
-rw-r--r--calendar/gui/gnome-cal.c12
-rw-r--r--calendar/gui/tag-calendar.c2
12 files changed, 52 insertions, 43 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 7b1b0fa673..45e5770897 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,44 @@
+2001-07-11 Federico Mena Quintero <federico@ximian.com>
+
+ Fixes bug #4380 as well as some leftovers from the days of struct
+ tm and some uninitialized values.
+
+ * gui/gnome-cal.c
+ (gnome_calendar_on_date_navigator_selection_changed): Initialize
+ the icaltimetype structures completely.
+ (gnome_calendar_init): Do not reset priv->zone to NULL here, since
+ it was set by gnome_calendar_update_config_settings() from
+ setup_widgets().
+
+ * gui/calendar-model.c (set_completed): Do not set is_daylight.
+
+ * gui/e-day-view.c (e_day_view_convert_grid_position_to_time):
+ Likewise.
+
+ * gui/e-week-view.c (e_week_view_set_timezone): Likewise.
+
+ * cal-util/cal-recur.c (generate_instances_for_chunk): Likewise,
+ and initialize start_tt and end_tt completely.
+
+ * cal-util/timeutil.c (time_year_begin_with_zone): Likewise.
+ (time_month_begin_with_zone): Likewise.
+ (time_week_begin_with_zone): Likewise.
+ (time_day_begin_with_zone): Likewise.
+ (time_day_end_with_zone): Likewise.
+ (time_from_isodate): Likewise.
+
+ * gui/dialogs/task-page.c (task_page_fill_component): Initialize
+ icaltime before using it.
+
+ * gui/dialogs/event-page.c (event_page_fill_component): Likewise.
+
+ * gui/dialogs/recurrence-page.c (simple_recur_to_comp): Removed an
+ unused icaltimetype.
+
+ * gui/dialogs/task-details-page.c
+ (task_details_page_fill_component): Initialize icaltime before
+ using it.
+
2001-07-11 JP Rosevear <jpr@ximian.com>
* gui/component-factory.c: fix the calendar not exiting with a
diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c
index 8df567fa5c..13c9f0533f 100644
--- a/calendar/cal-util/cal-recur.c
+++ b/calendar/cal-util/cal-recur.c
@@ -1201,13 +1201,13 @@ generate_instances_for_chunk (CalComponent *comp,
g_print ("Checking occurrence: %s\n",
cal_obj_time_to_string (occ));
#endif
+ start_tt = icaltime_null_time ();
start_tt.year = occ->year;
start_tt.month = occ->month + 1;
start_tt.day = occ->day;
start_tt.hour = occ->hour;
start_tt.minute = occ->minute;
start_tt.second = occ->second;
- start_tt.is_daylight = -1;
start_time = icaltime_as_timet_with_zone (start_tt, zone);
if (start_time == -1) {
@@ -1244,13 +1244,13 @@ generate_instances_for_chunk (CalComponent *comp,
cal_obj_time_add_seconds (occ, duration_seconds);
}
+ end_tt = icaltime_null_time ();
end_tt.year = occ->year;
end_tt.month = occ->month + 1;
end_tt.day = occ->day;
end_tt.hour = occ->hour;
end_tt.minute = occ->minute;
end_tt.second = occ->second;
- end_tt.is_daylight = -1;
end_time = icaltime_as_timet_with_zone (end_tt, zone);
if (end_time == -1) {
diff --git a/calendar/cal-util/timeutil.c b/calendar/cal-util/timeutil.c
index eb68376449..3a9308c1e1 100644
--- a/calendar/cal-util/timeutil.c
+++ b/calendar/cal-util/timeutil.c
@@ -279,7 +279,6 @@ time_year_begin_with_zone (time_t time, icaltimezone *zone)
tt.hour = 0;
tt.minute = 0;
tt.second = 0;
- tt.is_daylight = -1;
/* Convert back to a time_t. */
return icaltime_as_timet_with_zone (tt, zone);
@@ -304,7 +303,6 @@ time_month_begin_with_zone (time_t time, icaltimezone *zone)
tt.hour = 0;
tt.minute = 0;
tt.second = 0;
- tt.is_daylight = -1;
/* Convert back to a time_t. */
return icaltime_as_timet_with_zone (tt, zone);
@@ -337,7 +335,6 @@ time_week_begin_with_zone (time_t time, int week_start_day, icaltimezone *zone)
tt.hour = 0;
tt.minute = 0;
tt.second = 0;
- tt.is_daylight = -1;
/* Normalize it, to fix any overflow. */
tt = icaltime_normalize (tt);
@@ -364,7 +361,6 @@ time_day_begin_with_zone (time_t time, icaltimezone *zone)
tt.hour = 0;
tt.minute = 0;
tt.second = 0;
- tt.is_daylight = -1;
/* Convert back to a time_t. */
return icaltime_as_timet_with_zone (tt, zone);
@@ -389,7 +385,6 @@ time_day_end_with_zone (time_t time, icaltimezone *zone)
tt.hour = 0;
tt.minute = 0;
tt.second = 0;
- tt.is_daylight = -1;
/* Normalize it, to fix any overflow. */
tt = icaltime_normalize (tt);
@@ -559,8 +554,6 @@ time_from_isodate (const char *str)
+ digit_at (str, 14);
}
- tt.is_daylight = -1;
-
utc_zone = icaltimezone_get_utc_timezone ();
return icaltime_as_timet_with_zone (tt, utc_zone);
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index 10e18b106d..64b19065ff 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -1025,7 +1025,6 @@ set_completed (CalendarModel *model, CalComponent *comp, const char *value)
itt.hour = tmp_tm.tm_hour;
itt.minute = tmp_tm.tm_min;
itt.second = tmp_tm.tm_sec;
- itt.is_daylight = -1;
/* We assume that COMPLETED is entered in the current timezone,
even though it gets stored in UTC. */
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 5d0249bbd0..367412cbab 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -498,14 +498,12 @@ event_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* Dates */
+ icaltime = icaltime_null_time ();
+
date.value = &icaltime;
date.tzid = NULL;
- icaltime.is_utc = 0;
/* FIXME: We should use is_date at some point. */
- icaltime.is_date = 0;
- icaltime.is_daylight = 0;
- icaltime.second = 0;
date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time),
&icaltime.year,
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index 54cd1e25c3..4938877133 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -614,7 +614,6 @@ simple_recur_to_comp (RecurrencePage *rpage, CalComponent *comp)
GSList l;
enum ending_type ending_type;
gboolean date_set;
- struct icaltimetype icaltime = icaltime_null_time ();
priv = rpage->priv;
@@ -756,12 +755,6 @@ simple_recur_to_comp (RecurrencePage *rpage, CalComponent *comp)
g_assert (priv->ending_date_edit != NULL);
g_assert (E_IS_DATE_EDIT (priv->ending_date_edit));
- /* UNTIL must be in UTC, unless it is a date. So we probably
- want to convert it to local time when showing. */
- icaltime.is_utc = 0;
- icaltime.is_date = 1;
- icaltime.is_daylight = 0;
-
date_set = e_date_edit_get_date (E_DATE_EDIT (priv->ending_date_edit),
&r.until.year,
&r.until.month,
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 52a1fe2706..1af190a201 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -301,10 +301,10 @@ task_details_page_fill_component (CompEditorPage *page, CalComponent *comp)
tdpage = TASK_DETAILS_PAGE (page);
priv = tdpage->priv;
+ icaltime = icaltime_null_time ();
+
/* COMPLETED must be in UTC. */
icaltime.is_utc = 1;
- icaltime.is_date = 0;
- icaltime.is_daylight = 0;
/* Completed Date. */
date_set = e_date_edit_get_date (E_DATE_EDIT (priv->completed_date),
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 6127087b3b..2ba37b7c6a 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -554,14 +554,12 @@ task_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* Dates */
+ icaltime = icaltime_null_time ();
+
date.value = &icaltime;
date.tzid = NULL;
- icaltime.is_utc = 0;
/* FIXME: We should use is_date at some point. */
- icaltime.is_date = 0;
- icaltime.is_daylight = 0;
- icaltime.second = 0;
/* Due Date. */
date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date),
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 9e38224bb0..538fede50e 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -5492,7 +5492,6 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view,
tt.hour = minutes / 60;
tt.minute = minutes % 60;
tt.second = 0;
- tt.is_daylight = -1;
val = icaltime_as_timet_with_zone (tt, day_view->zone);
return val;
@@ -5527,8 +5526,7 @@ e_day_view_convert_time_to_grid_position (EDayView *day_view,
tt = icaltime_from_timet_with_zone (time, FALSE, day_view->zone);
minutes = tt.hour * 60 + tt.minute;
- minutes -= day_view->first_hour_shown * 60
- + day_view->first_minute_shown;
+ minutes -= day_view->first_hour_shown * 60 + day_view->first_minute_shown;
*row = minutes / day_view->mins_per_row;
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 264827e590..62e44644fa 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1691,7 +1691,6 @@ e_week_view_set_timezone (EWeekView *week_view,
tt.year = g_date_year (&week_view->first_day_shown);
tt.month = g_date_month (&week_view->first_day_shown);
tt.day = g_date_day (&week_view->first_day_shown);
- tt.is_daylight = -1;
lower = icaltime_as_timet_with_zone (tt, zone);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 166f715fa4..cf8d12bc14 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -506,8 +506,6 @@ gnome_calendar_init (GnomeCalendar *gcal)
priv->view_collection = NULL;
priv->view_menus = NULL;
-
- priv->zone = NULL;
}
/* Used from g_hash_table_foreach(); frees an UID string */
@@ -1816,22 +1814,16 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem,
end_month = g_date_month (&new_end_date);
end_day = g_date_day (&new_end_date);
+ tt = icaltime_null_time ();
tt.year = start_year;
tt.month = start_month;
tt.day = start_day;
- tt.hour = 0;
- tt.minute = 0;
- tt.second = 0;
- tt.is_daylight = -1;
priv->selection_start_time = icaltime_as_timet_with_zone (tt, priv->zone);
+ tt = icaltime_null_time ();
tt.year = end_year;
tt.month = end_month;
tt.day = end_day;
- tt.hour = 0;
- tt.minute = 0;
- tt.second = 0;
- tt.is_daylight = -1;
icaltime_adjust (&tt, 1, 0, 0, 0);
priv->selection_end_time = icaltime_as_timet_with_zone (tt, priv->zone);
diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c
index f0f8951842..8cdbac8462 100644
--- a/calendar/gui/tag-calendar.c
+++ b/calendar/gui/tag-calendar.c
@@ -61,12 +61,10 @@ prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c)
start_tt.year = start_year;
start_tt.month = start_month + 1;
start_tt.day = start_day;
- start_tt.is_daylight = -1;
end_tt.year = end_year;
end_tt.month = end_month + 1;
end_tt.day = end_day;
- end_tt.is_daylight = -1;
icaltime_adjust (&end_tt, 1, 0, 0, 0);