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
This commit is contained in:
Erick Pérez Castellanos
2014-12-22 08:38:18 -05:00
parent 829d6762cd
commit 56f7f88572
+5 -2
View File
@@ -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);
}