[gnome-calendar] month-view: fix insert ordered widgets
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] month-view: fix insert ordered widgets
- Date: Mon, 22 Dec 2014 13:41:51 +0000 (UTC)
commit 56f7f88572d3720c671ea2bea2930eba7b9b7fff
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Sat Dec 20 19:51:50 2014 -0500
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 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 515b2b9..8b66002 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]