From 43c5c01d33e0f4b849fe93ba468827180727eadc Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 31 Aug 2003 21:29:43 +0000 Subject: [PATCH] parse all the menu files specified --- openbox/menu.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/openbox/menu.c b/openbox/menu.c index c8e16e48..cf405720 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -77,27 +77,28 @@ void menu_startup() menu_parse_inst = parse_startup(); + menu_parse_state.menus = NULL; + parse_register(menu_parse_inst, "menu", parse_menu, &menu_parse_state); + parse_register(menu_parse_inst, "item", parse_menu_item, + &menu_parse_state); + parse_register(menu_parse_inst, "separator", + parse_menu_separator, &menu_parse_state); + for (it = config_menu_files; it; it = g_slist_next(it)) { - if (menu_open(it->data, &doc, &node)) + if (menu_open(it->data, &doc, &node)) { loaded = TRUE; - + parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); + xmlFreeDoc(doc); + } } - if (!loaded) - loaded = menu_open("menu", &doc, &node); - - if (loaded) { - menu_parse_state.menus = NULL; - - parse_register(menu_parse_inst, "menu", parse_menu, &menu_parse_state); - parse_register(menu_parse_inst, "item", parse_menu_item, - &menu_parse_state); - parse_register(menu_parse_inst, "separator", - parse_menu_separator, &menu_parse_state); - parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); - xmlFreeDoc(doc); - - g_assert(menu_parse_state.menus == NULL); + if (!loaded) { + if (menu_open("menu", &doc, &node)) { + parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); + xmlFreeDoc(doc); + } } + + g_assert(menu_parse_state.menus == NULL); client_add_destructor(client_dest); } -- 2.45.2