[gnome-calendar] month-view: optimized event-widget parts removal
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] month-view: optimized event-widget parts removal
- Date: Tue, 17 Feb 2015 13:17:14 +0000 (UTC)
commit 96c8120d286b1d7a99052ae97f1c47388c20c3dc
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Mon Feb 16 17:37:01 2015 -0500
month-view: optimized event-widget parts removal
src/gcal-month-view.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index b707007..be65925 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -785,7 +785,7 @@ gcal_month_view_size_allocate (GtkWidget *widget,
GtkAllocation child_allocation;
gint natural_height;
- GList *widgets, *l, *aux, *l2 = NULL;
+ GList *widgets, *aux, *l = NULL;
GHashTableIter iter;
gpointer key, value;
@@ -802,16 +802,10 @@ gcal_month_view_size_allocate (GtkWidget *widget,
/* remove every widget' parts, but the master widget */
widgets = g_hash_table_get_values (ppriv->children);
for (aux = widgets; aux != NULL; aux = g_list_next (aux))
- {
- l = g_list_next ((GList*) aux->data);
- for (; l != NULL; l = g_list_next (l))
- l2 = g_list_append (l2, l->data);
- }
+ l = g_list_concat (l, g_list_copy (g_list_next (aux->data)));
g_list_free (widgets);
- for (aux = l2; aux != NULL; aux = g_list_next (aux))
- gtk_widget_destroy ((GtkWidget*) aux->data);
- g_list_free (l2);
+ g_list_free_full (l, (GDestroyNotify) gtk_widget_destroy);
/* clean overflow information */
g_hash_table_remove_all (ppriv->overflow_cells);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]