Commit b43a41e7 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Don't return a list of NULLs. (#325723, Steve Chaplin)

2006-01-04  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c (gtk_ui_manager_get_toplevels): Don't return
	a list of NULLs.  (#325723, Steve Chaplin)
parent cfe00e57
2006-01-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkuimanager.c (gtk_ui_manager_get_toplevels): Don't return
a list of NULLs. (#325723, Steve Chaplin)
2006-01-04 Rodrigo Moya <rodrigo@novell.com>
* gtk/gtkbindings.c (binding_signal_new): guard against multiplying
......
2006-01-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkuimanager.c (gtk_ui_manager_get_toplevels): Don't return
a list of NULLs. (#325723, Steve Chaplin)
2006-01-04 Rodrigo Moya <rodrigo@novell.com>
* gtk/gtkbindings.c (binding_signal_new): guard against multiplying
......
......@@ -755,30 +755,36 @@ gtk_ui_manager_get_widget (GtkUIManager *self,
return GTK_UI_MANAGER_GET_CLASS (self)->get_widget (self, path);
}
typedef struct {
GtkUIManagerItemType types;
GSList *list;
} ToplevelData;
static void
collect_toplevels (GNode *node,
gpointer user_data)
{
struct {
GtkUIManagerItemType types;
GSList *list;
} *data = user_data;
switch (NODE_INFO (node)->type) {
case NODE_TYPE_MENUBAR:
if (data->types & GTK_UI_MANAGER_MENUBAR)
data->list = g_slist_prepend (data->list, NODE_INFO (node)->proxy);
break;
case NODE_TYPE_TOOLBAR:
if (data->types & GTK_UI_MANAGER_TOOLBAR)
data->list = g_slist_prepend (data->list, NODE_INFO (node)->proxy);
break;
case NODE_TYPE_POPUP:
if (data->types & GTK_UI_MANAGER_POPUP)
data->list = g_slist_prepend (data->list, NODE_INFO (node)->proxy);
break;
default: ;
}
ToplevelData *data = user_data;
if (NODE_INFO (node)->proxy)
{
switch (NODE_INFO (node)->type)
{
case NODE_TYPE_MENUBAR:
if (data->types & GTK_UI_MANAGER_MENUBAR)
data->list = g_slist_prepend (data->list, NODE_INFO (node)->proxy);
break;
case NODE_TYPE_TOOLBAR:
if (data->types & GTK_UI_MANAGER_TOOLBAR)
data->list = g_slist_prepend (data->list, NODE_INFO (node)->proxy);
break;
case NODE_TYPE_POPUP:
if (data->types & GTK_UI_MANAGER_POPUP)
data->list = g_slist_prepend (data->list, NODE_INFO (node)->proxy);
break;
default: ;
}
}
}
/**
......@@ -799,10 +805,7 @@ GSList *
gtk_ui_manager_get_toplevels (GtkUIManager *self,
GtkUIManagerItemType types)
{
struct {
GtkUIManagerItemType types;
GSList *list;
} data;
ToplevelData data;
g_return_val_if_fail (GTK_IS_UI_MANAGER (self), NULL);
g_return_val_if_fail ((~(GTK_UI_MANAGER_MENUBAR |
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment