[gnome-calendar] Keeping event widget sorted inside views.
- From: Erick PÃrez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] Keeping event widget sorted inside views.
- Date: Sat, 1 Dec 2012 20:34:30 +0000 (UTC)
commit ddae6624a3a3681033e4c955907f968985583f07
Author: Erick PÃrez Castellanos <erick red gmail com>
Date: Thu Nov 22 11:11:51 2012 -0500
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 c856aa5..704b3b7 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 e24f166..72e74c8 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]