From a753b72a982b384b91a78ef91aa6088ca11c9824 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Tue, 3 Jul 2001 09:12:12 +0000 Subject: fix warning, and added some debug messages. 2001-07-03 Damon Chaplin * gui/e-day-view.c (query_obj_updated_cb): fix warning, and added some debug messages. * gui/dialogs/comp-editor-util.c (write_label_piece): * gui/e-day-view-top-item.c (e_day_view_top_item_draw): call mktime() to set the weekday, though this is a temporary fix. svn path=/trunk/; revision=10737 --- calendar/ChangeLog | 9 +++++++++ calendar/gui/dialogs/comp-editor-util.c | 6 +++++- calendar/gui/e-day-view-top-item.c | 5 +++++ calendar/gui/e-day-view.c | 5 ++++- 4 files changed, 23 insertions(+), 2 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 58e7050336..cff0c1a1a5 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2001-07-03 Damon Chaplin + + * gui/e-day-view.c (query_obj_updated_cb): fix warning, and added + some debug messages. + + * gui/dialogs/comp-editor-util.c (write_label_piece): + * gui/e-day-view-top-item.c (e_day_view_top_item_draw): call mktime() + to set the weekday, though this is a temporary fix. + 2001-07-03 Damon Chaplin * pcs/cal-backend.[hc]: added virtual method to get a VTIMEZONE diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index e3cf454e84..dcad6a44cf 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -93,7 +93,7 @@ static void write_label_piece (struct icaltimetype *tt, char *buffer, int size, char *stext, char *etext) { - struct tm tmp_tm; + struct tm tmp_tm = { 0 }; int len; /* FIXME: May want to convert the time to an appropriate zone. */ @@ -109,6 +109,10 @@ write_label_piece (struct icaltimetype *tt, char *buffer, int size, tmp_tm.tm_sec = tt->second; tmp_tm.tm_isdst = -1; + /* Call mktime() to set the weekday. FIXME: Don't do this. mktime() + could in theory adjust the time if it thought it was invalid. */ + mktime (&tmp_tm); + len = strlen (buffer); e_time_format_date_and_time (&tmp_tm, calendar_config_get_24_hour_format (), diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 62e58f7ec5..1417dfee1e 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -274,6 +274,11 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item, day_start.tm_mday = day_start_tt.day; day_start.tm_isdst = -1; + /* Call mktime() to set the weekday. FIXME: Don't do this. + mktime() could in theory adjust the time if it thought it + was invalid. */ + mktime (&day_start); + if (day_view->date_format == E_DAY_VIEW_DATE_FULL) /* strftime format %A = full weekday name, %d = day of month, %B = full month name. Don't use any other specifiers. */ diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 0cf6704798..e854576659 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1486,7 +1486,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid, cal_recur_generate_instances (comp, day_view->lower, day_view->upper, e_day_view_add_event, day_view, - cal_client_resolve_tzid, day_view->client); + (CalRecurResolveTimezoneFn) cal_client_resolve_tzid, day_view->client); gtk_object_unref (GTK_OBJECT (comp)); e_day_view_check_layout (day_view); @@ -2222,6 +2222,9 @@ e_day_view_recalc_day_starts (EDayView *day_view, day_view->day_starts[day] = time_add_day (day_view->day_starts[day - 1], 1); } + for (day = 0; day <= day_view->days_shown; day++) + g_print ("Day Starts %i: %s", day, ctime (&day_view->day_starts[day])); + day_view->lower = start_time; day_view->upper = day_view->day_starts[day_view->days_shown]; } -- cgit