add obt_parse_tree_from_root and use it, cuz it's nice
This commit is contained in:
parent
fdabb69f4f
commit
edeb0a2727
4 changed files with 9 additions and 5 deletions
|
@ -304,6 +304,11 @@ void obt_parse_tree(ObtParseInst *i, xmlNodePtr node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void obt_parse_tree_from_root(ObtParseInst *i)
|
||||||
|
{
|
||||||
|
obt_parse_tree(i, i->root->children);
|
||||||
|
}
|
||||||
|
|
||||||
gchar *obt_parse_node_string(xmlNodePtr node)
|
gchar *obt_parse_node_string(xmlNodePtr node)
|
||||||
{
|
{
|
||||||
xmlChar *c = xmlNodeGetContent(node);
|
xmlChar *c = xmlNodeGetContent(node);
|
||||||
|
|
|
@ -61,6 +61,7 @@ void obt_parse_close(ObtParseInst *inst);
|
||||||
void obt_parse_register(ObtParseInst *inst, const gchar *tag,
|
void obt_parse_register(ObtParseInst *inst, const gchar *tag,
|
||||||
ObtParseCallback func, gpointer data);
|
ObtParseCallback func, gpointer data);
|
||||||
void obt_parse_tree(ObtParseInst *i, xmlNodePtr node);
|
void obt_parse_tree(ObtParseInst *i, xmlNodePtr node);
|
||||||
|
void obt_parse_tree_from_root(ObtParseInst *i);
|
||||||
|
|
||||||
|
|
||||||
/* helpers */
|
/* helpers */
|
||||||
|
|
|
@ -94,8 +94,7 @@ void menu_startup(gboolean reconfig)
|
||||||
"openbox_menu"))
|
"openbox_menu"))
|
||||||
{
|
{
|
||||||
loaded = TRUE;
|
loaded = TRUE;
|
||||||
obt_parse_tree(menu_parse_inst,
|
obt_parse_tree_from_root(menu_parse_inst);
|
||||||
obt_parse_instance_root(menu_parse_inst)->children);
|
|
||||||
obt_parse_close(menu_parse_inst);
|
obt_parse_close(menu_parse_inst);
|
||||||
} else
|
} else
|
||||||
g_message(_("Unable to find a valid menu file '%s'"),
|
g_message(_("Unable to find a valid menu file '%s'"),
|
||||||
|
@ -107,8 +106,7 @@ void menu_startup(gboolean reconfig)
|
||||||
"menu.xml",
|
"menu.xml",
|
||||||
"openbox_menu"))
|
"openbox_menu"))
|
||||||
{
|
{
|
||||||
obt_parse_tree(menu_parse_inst,
|
obt_parse_tree_from_root(menu_parse_inst);
|
||||||
obt_parse_instance_root(menu_parse_inst)->children);
|
|
||||||
obt_parse_close(menu_parse_inst);
|
obt_parse_close(menu_parse_inst);
|
||||||
} else
|
} else
|
||||||
g_message(_("Unable to find a valid menu file '%s'"),
|
g_message(_("Unable to find a valid menu file '%s'"),
|
||||||
|
|
|
@ -230,7 +230,7 @@ gint main(gint argc, gchar **argv)
|
||||||
if (obt_parse_load_config_file(i, "openbox", "rc.xml",
|
if (obt_parse_load_config_file(i, "openbox", "rc.xml",
|
||||||
"openbox_config"))
|
"openbox_config"))
|
||||||
{
|
{
|
||||||
obt_parse_tree(i, obt_parse_instance_root(i)->children);
|
obt_parse_tree_from_root(i);
|
||||||
obt_parse_close(i);
|
obt_parse_close(i);
|
||||||
} else
|
} else
|
||||||
g_message(_("Unable to find a valid config file, using some simple defaults"));
|
g_message(_("Unable to find a valid config file, using some simple defaults"));
|
||||||
|
|
Loading…
Reference in a new issue