From 56f7f88572d3720c671ea2bea2930eba7b9b7fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Sat, 20 Dec 2014 19:51:50 -0500 Subject: [PATCH] month-view: fix insert ordered widgets The head of the list might changed when ordering the list at insertion, then, some events was getting lost --- src/gcal-month-view.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index 515b2b98..8b660026 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -1638,8 +1638,11 @@ gcal_month_view_add (GtkContainer *container, l = g_hash_table_lookup (priv->single_day_children, GINT_TO_POINTER (date->day)); l = g_list_insert_sorted (l, widget, (GCompareFunc) gcal_event_widget_compare_by_start_date); - if (g_list_length (l) == 1) - g_hash_table_insert (priv->single_day_children, GINT_TO_POINTER (date->day), l); + if (g_list_length (l) != 1) + { + g_hash_table_steal (priv->single_day_children, GINT_TO_POINTER (date->day)); + } + g_hash_table_insert (priv->single_day_children, GINT_TO_POINTER (date->day), l); g_free (date); }