From 3b67321d5cfb618a93720567db9291a712cff5d6 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 26 Feb 2003 12:26:47 +0000 Subject: Remove also the toolbar when removing the last item 2003-02-26 Marco Pesenti Gritti * lib/widgets/ephy-toolbars-group.c: (ephy_toolbars_group_remove_item): Remove also the toolbar when removing the last item --- lib/widgets/ephy-toolbars-group.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/widgets') diff --git a/lib/widgets/ephy-toolbars-group.c b/lib/widgets/ephy-toolbars-group.c index 3711efe2d..da8ef8f38 100755 --- a/lib/widgets/ephy-toolbars-group.c +++ b/lib/widgets/ephy-toolbars-group.c @@ -511,15 +511,23 @@ ephy_toolbars_group_remove_item (EphyToolbarsGroup *t, EphyToolbarsItem *item) { GNode *node; + GNode *toolbar; g_return_if_fail (IS_EPHY_TOOLBARS_GROUP (t)); g_return_if_fail (item != NULL); node = g_node_find (t->priv->toolbars, G_IN_ORDER, G_TRAVERSE_ALL, item); g_return_if_fail (node != NULL); + toolbar = node->parent; free_toolbar_node (node->data); g_node_destroy (node); + if (g_node_n_children (toolbar) == 0) + { + free_toolbar_node (toolbar->data); + g_node_destroy (toolbar); + } + toolbars_group_save (t); g_signal_emit (G_OBJECT (t), ephy_toolbars_group_signals[CHANGED], 0); -- cgit v1.2.3