From f6963100c2509175cbd22b1556273ddbc0dd4e7d Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Thu, 2 Apr 1998 20:35:12 +0000 Subject: Day events are now cached inside the widget. They get initialized at this 1998-04-02 Miguel de Icaza * gncal-day-view.c (gncal_day_view_update): Day events are now cached inside the widget. They get initialized at this time. * view-utils.c (view_utils_draw_events): Use the list of events. svn path=/trunk/; revision=95 --- calendar/gui/view-utils.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'calendar/gui/view-utils.c') diff --git a/calendar/gui/view-utils.c b/calendar/gui/view-utils.c index 6b317fd70e..6e8c4044dd 100644 --- a/calendar/gui/view-utils.c +++ b/calendar/gui/view-utils.c @@ -11,6 +11,7 @@ /* FIXME: remove this function later */ +#if 0 static GList * calendar_get_events_in_range (Calendar *cal, time_t start, time_t end, GCompareFunc sort_func) { @@ -50,10 +51,10 @@ calendar_get_events_in_range (Calendar *cal, time_t start, time_t end, GCompareF return list; } - +#endif void view_utils_draw_events (GtkWidget *widget, GdkWindow *window, GdkGC *gc, GdkRectangle *area, - int flags, Calendar *calendar, time_t start, time_t end) + int flags, GList *events, time_t start, time_t end) { int font_height; int x, y, max_y; @@ -62,7 +63,7 @@ view_utils_draw_events (GtkWidget *widget, GdkWindow *window, GdkGC *gc, GdkRect struct tm tm_start, tm_end; char *str; iCalObject *ico; - GList *the_list, *list; + GList *list; gdk_gc_set_clip_rectangle (gc, area); @@ -70,9 +71,7 @@ view_utils_draw_events (GtkWidget *widget, GdkWindow *window, GdkGC *gc, GdkRect max_y = area->y + area->height - font_height * ((flags & VIEW_UTILS_DRAW_SPLIT) ? 2 : 1); - the_list = calendar_get_events_in_range (calendar, start, end, calendar_compare_by_dtstart); - - for (y = area->y, list = the_list; (y < max_y) && list; y += font_height, list = list->next) { + for (y = area->y, list = events; (y < max_y) && list; y += font_height, list = list->next) { ico = list->data; tm_start = *localtime (&ico->dtstart); @@ -106,8 +105,5 @@ view_utils_draw_events (GtkWidget *widget, GdkWindow *window, GdkGC *gc, GdkRect y + widget->style->font->ascent, str); } - - g_list_free (the_list); - gdk_gc_set_clip_rectangle (gc, NULL); } -- cgit