summaryrefslogtreecommitdiff
path: root/parser/parse.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-07 02:38:13 +0000
committerDana Jansens <danakj@orodu.net>2007-05-07 02:38:13 +0000
commit24c0d618471276fd514cd666bc7067d30be8d0ca (patch)
tree77bff38312cc980b549e1db1ac5bb41ad698cbcb /parser/parse.c
parent974391d345adf122816831cc24cbdfec5616aed1 (diff)
add the 'engine="box"' to the theme format, and require it to be there so we can change that in the future
Diffstat (limited to 'parser/parse.c')
-rw-r--r--parser/parse.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/parser/parse.c b/parser/parse.c
index 43d076e1..16745650 100644
--- a/parser/parse.c
+++ b/parser/parse.c
@@ -108,20 +108,35 @@ gboolean parse_load_theme(const gchar *name, xmlDocPtr *doc, xmlNodePtr *root,
GSList *it;
gchar *path;
gboolean r = FALSE;
+ gchar *eng;
/* backward compatibility.. */
path = g_build_filename(g_get_home_dir(), ".themes", name,
"openbox-3", "themerc.xml", NULL);
- if ((r = parse_load(path, "openbox_theme", doc, root)))
- *retpath = g_path_get_dirname(path);
+ if (parse_load(path, "openbox_theme", doc, root) &&
+ parse_attr_string("engine", *root, &eng))
+ {
+ if (!strcmp(eng, "box")) {
+ *retpath = g_path_get_dirname(path);
+ r = TRUE;
+ }
+ g_free(eng);
+ }
g_free(path);
if (!r) {
for (it = xdg_data_dir_paths; !r && it; it = g_slist_next(it)) {
path = g_build_filename(it->data, "themes", name, "openbox-3",
"themerc.xml", NULL);
- if ((r = parse_load(path, "openbox_theme", doc, root)))
- *retpath = g_path_get_dirname(path);
+ if (parse_load(path, "openbox_theme", doc, root) &&
+ parse_attr_string("engine", *root, &eng))
+ {
+ if (!strcmp(eng, "box")) {
+ *retpath = g_path_get_dirname(path);
+ r = TRUE;
+ }
+ g_free(eng);
+ }
g_free(path);
}
}