[glade3] Fix glade_widget_get_children() to always return a correct list
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] Fix glade_widget_get_children() to always return a correct list
- Date: Fri, 14 May 2010 22:02:42 +0000 (UTC)
commit a24cecf24f41cc582427481e64d4b143cecbed03
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]