aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/view-utils.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@nuclecu.unam.mx>1998-04-03 04:35:12 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-03 04:35:12 +0800
commitf6963100c2509175cbd22b1556273ddbc0dd4e7d (patch)
tree5cfbf3602fda3fe5ecaaa716a2094c5aa2f3c0a7 /calendar/gui/view-utils.c
parentd4f096e0ca0ec461d5ab7a3369aaa95480561d92 (diff)
downloadgsoc2013-evolution-f6963100c2509175cbd22b1556273ddbc0dd4e7d.tar
gsoc2013-evolution-f6963100c2509175cbd22b1556273ddbc0dd4e7d.tar.gz
gsoc2013-evolution-f6963100c2509175cbd22b1556273ddbc0dd4e7d.tar.bz2
gsoc2013-evolution-f6963100c2509175cbd22b1556273ddbc0dd4e7d.tar.lz
gsoc2013-evolution-f6963100c2509175cbd22b1556273ddbc0dd4e7d.tar.xz
gsoc2013-evolution-f6963100c2509175cbd22b1556273ddbc0dd4e7d.tar.zst
gsoc2013-evolution-f6963100c2509175cbd22b1556273ddbc0dd4e7d.zip
Day events are now cached inside the widget. They get initialized at this
1998-04-02 Miguel de Icaza <miguel@nuclecu.unam.mx> * 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
Diffstat (limited to 'calendar/gui/view-utils.c')
-rw-r--r--calendar/gui/view-utils.c14
1 files changed, 5 insertions, 9 deletions
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);
}