[glade3/project-tree-model] Fix glade_widget_get_children() to always return a correct list
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/project-tree-model] Fix glade_widget_get_children() to always return a correct list
- Date: Sun, 9 May 2010 19:20:48 +0000 (UTC)
commit ec577d5a51cde43ae466f5d72449186023556a3a
Author: Johannes Schmid <jhs gnome org>
Date: Sun May 9 21:04:33 2010 +0200
Fix glade_widget_get_children() to always return a correct list
gladeui/glade-widget.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 95c04f2..e2d3876 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -3450,24 +3450,25 @@ glade_widget_set_parent (GladeWidget *widget,
GList *
glade_widget_get_children (GladeWidget *widget)
{
- GladeWidgetAdaptor *adaptor;
- GList *children = NULL;
+ GList *adapter_children;
+ GList *real_children = NULL;
GList *node;
g_return_val_if_fail (GLADE_IS_WIDGET (widget), NULL);
- adaptor = glade_widget_get_adaptor (widget);
- children = glade_widget_adaptor_get_children (adaptor, widget->object);
- for (node = children; node != NULL; node = g_list_next (node))
+ adapter_children = glade_widget_adaptor_get_children (glade_widget_get_adaptor (widget),
+ widget->object);
+
+ for (node = adapter_children; node != NULL; node = g_list_next (node))
{
- if (!glade_widget_get_from_gobject (node->data))
+ if (glade_widget_get_from_gobject (node->data))
{
- children = g_list_delete_link (children, node);
- node = children;
+ real_children = g_list_append (real_children, node->data);
}
}
+ g_list_free (adapter_children);
- return children;
+ return real_children;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]