From ddae6624a3a3681033e4c955907f968985583f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Thu, 22 Nov 2012 11:11:51 -0500 Subject: [PATCH] Keeping event widget sorted inside views. Still missing to fix GcalWeekView, but that one needs reworking. --- src/gcal-month-view.c | 4 +++- src/gcal-year-view.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index c856aa5a..704b3b77 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -730,7 +730,9 @@ gcal_month_view_add (GtkContainer *container, new_child->widget = widget; new_child->hidden_by_me = FALSE; - priv->days[day] = g_list_append (priv->days[day], new_child); + priv->days[day] = g_list_insert_sorted (priv->days[day], + new_child, + gcal_compare_event_widget_by_date); gtk_widget_set_parent (widget, GTK_WIDGET (container)); } diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c index e24f1667..72e74c89 100644 --- a/src/gcal-year-view.c +++ b/src/gcal-year-view.c @@ -427,7 +427,11 @@ gcal_year_view_add (GtkContainer *container, new_child->widget = widget; new_child->hidden_by_me = FALSE; - priv->months[date->month - 1] = g_list_append (priv->months[date->month - 1], new_child); + priv->months[date->month - 1] = + g_list_insert_sorted (priv->months[date->month - 1], + new_child, + gcal_compare_event_widget_by_date); + gtk_widget_set_parent (widget, GTK_WIDGET (container)); g_free (date);