Robustness improvements.

* gtk/gtkuimanager.c (update_node): Robustness improvements.
This commit is contained in:
Matthias Clasen 2003-09-17 22:44:01 +00:00
parent 3044d0f514
commit a7ad2a4663
6 changed files with 31 additions and 7 deletions

View File

@ -1,3 +1,7 @@
2003-09-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (update_node): Robustness improvements.
2003-09-17 Matthias Clasen <maclas@gmx.de> 2003-09-17 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (text_handler): Report unexpected character * gtk/gtkuimanager.c (text_handler): Report unexpected character

View File

@ -1,3 +1,7 @@
2003-09-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (update_node): Robustness improvements.
2003-09-17 Matthias Clasen <maclas@gmx.de> 2003-09-17 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (text_handler): Report unexpected character * gtk/gtkuimanager.c (text_handler): Report unexpected character

View File

@ -1,3 +1,7 @@
2003-09-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (update_node): Robustness improvements.
2003-09-17 Matthias Clasen <maclas@gmx.de> 2003-09-17 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (text_handler): Report unexpected character * gtk/gtkuimanager.c (text_handler): Report unexpected character

View File

@ -1,3 +1,7 @@
2003-09-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (update_node): Robustness improvements.
2003-09-17 Matthias Clasen <maclas@gmx.de> 2003-09-17 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (text_handler): Report unexpected character * gtk/gtkuimanager.c (text_handler): Report unexpected character

View File

@ -1,3 +1,7 @@
2003-09-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (update_node): Robustness improvements.
2003-09-17 Matthias Clasen <maclas@gmx.de> 2003-09-17 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.c (text_handler): Report unexpected character * gtk/gtkuimanager.c (text_handler): Report unexpected character

View File

@ -1722,13 +1722,15 @@ update_node (GtkUIManager *self,
/* Check if the node doesn't have an action and must have an action */ /* Check if the node doesn't have an action and must have an action */
if (action == NULL && if (action == NULL &&
info->type != NODE_TYPE_ROOT &&
info->type != NODE_TYPE_MENUBAR && info->type != NODE_TYPE_MENUBAR &&
info->type != NODE_TYPE_TOOLBAR && info->type != NODE_TYPE_TOOLBAR &&
info->type != NODE_TYPE_SEPARATOR && info->type != NODE_TYPE_SEPARATOR &&
info->type != NODE_TYPE_MENU_PLACEHOLDER && info->type != NODE_TYPE_MENU_PLACEHOLDER &&
info->type != NODE_TYPE_TOOLBAR_PLACEHOLDER) info->type != NODE_TYPE_TOOLBAR_PLACEHOLDER)
{ {
/* FIXME: Should we warn here? */ g_warning ("%s: missing action", info->name);
goto recurse_children; goto recurse_children;
} }
@ -2063,12 +2065,14 @@ update_node (GtkUIManager *self,
child = current->next; child = current->next;
update_node (self, current, add_tearoffs && (info->type != NODE_TYPE_POPUP)); update_node (self, current, add_tearoffs && (info->type != NODE_TYPE_POPUP));
} }
if (info->type == NODE_TYPE_MENU) if (info->proxy)
update_smart_separators (gtk_menu_item_get_submenu (GTK_MENU_ITEM (info->proxy))); {
else if (info->type == NODE_TYPE_TOOLBAR) if (info->type == NODE_TYPE_MENU)
update_smart_separators (info->proxy); update_smart_separators (gtk_menu_item_get_submenu (GTK_MENU_ITEM (info->proxy)));
else if (info->type == NODE_TYPE_TOOLBAR)
update_smart_separators (info->proxy);
}
/* handle cleanup of dead nodes */ /* handle cleanup of dead nodes */
if (node->children == NULL && info->uifiles == NULL) if (node->children == NULL && info->uifiles == NULL)