]> Dogcows Code - chaz/openbox/commitdiff
parse all the menu files specified
authorDana Jansens <danakj@orodu.net>
Sun, 31 Aug 2003 21:29:43 +0000 (21:29 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 31 Aug 2003 21:29:43 +0000 (21:29 +0000)
openbox/menu.c

index c8e16e482ace489783d852ff491ac56a32836a01..cf405720ab211cab138ba8dd930a4a1ce973b6a2 100644 (file)
@@ -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);
 }
This page took 0.028733 seconds and 4 git commands to generate.