From a7ad2a46634aa17687521d055bf2f47e1c9738f8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 17 Sep 2003 22:44:01 +0000 Subject: [PATCH] Robustness improvements. * gtk/gtkuimanager.c (update_node): Robustness improvements. --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-4 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gtk/gtkuimanager.c | 18 +++++++++++------- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4aa690e874..6f05370c41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-09-18 Matthias Clasen + + * gtk/gtkuimanager.c (update_node): Robustness improvements. + 2003-09-17 Matthias Clasen * gtk/gtkuimanager.c (text_handler): Report unexpected character diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4aa690e874..6f05370c41 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +2003-09-18 Matthias Clasen + + * gtk/gtkuimanager.c (update_node): Robustness improvements. + 2003-09-17 Matthias Clasen * gtk/gtkuimanager.c (text_handler): Report unexpected character diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 4aa690e874..6f05370c41 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +2003-09-18 Matthias Clasen + + * gtk/gtkuimanager.c (update_node): Robustness improvements. + 2003-09-17 Matthias Clasen * gtk/gtkuimanager.c (text_handler): Report unexpected character diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4aa690e874..6f05370c41 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +2003-09-18 Matthias Clasen + + * gtk/gtkuimanager.c (update_node): Robustness improvements. + 2003-09-17 Matthias Clasen * gtk/gtkuimanager.c (text_handler): Report unexpected character diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4aa690e874..6f05370c41 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +2003-09-18 Matthias Clasen + + * gtk/gtkuimanager.c (update_node): Robustness improvements. + 2003-09-17 Matthias Clasen * gtk/gtkuimanager.c (text_handler): Report unexpected character diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c index 0cd712e8e0..838a896e2a 100644 --- a/gtk/gtkuimanager.c +++ b/gtk/gtkuimanager.c @@ -1722,13 +1722,15 @@ update_node (GtkUIManager *self, /* Check if the node doesn't have an action and must have an action */ if (action == NULL && + info->type != NODE_TYPE_ROOT && info->type != NODE_TYPE_MENUBAR && info->type != NODE_TYPE_TOOLBAR && info->type != NODE_TYPE_SEPARATOR && info->type != NODE_TYPE_MENU_PLACEHOLDER && info->type != NODE_TYPE_TOOLBAR_PLACEHOLDER) { - /* FIXME: Should we warn here? */ + g_warning ("%s: missing action", info->name); + goto recurse_children; } @@ -2063,12 +2065,14 @@ update_node (GtkUIManager *self, child = current->next; update_node (self, current, add_tearoffs && (info->type != NODE_TYPE_POPUP)); } - - if (info->type == NODE_TYPE_MENU) - 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); - + + if (info->proxy) + { + if (info->type == NODE_TYPE_MENU) + 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 */ if (node->children == NULL && info->uifiles == NULL)