X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Ftheme.c;h=8ad8c8415a998a8206835b0abf6baad0cd029a65;hb=c1b2fc5324522f74a14a5cfa210c95e1509a6e7f;hp=907fd0b55226531ba82f5dcb891da3636c78444c;hpb=3a607fad9df628ab16e0f7436dfbfc9b22634003;p=chaz%2Fopenbox diff --git a/render/theme.c b/render/theme.c index 907fd0b5..8ad8c841 100644 --- a/render/theme.c +++ b/render/theme.c @@ -4,6 +4,7 @@ #include "mask.h" #include "theme.h" #include "icon.h" +#include "parser/parse.h" #include #include @@ -1059,21 +1060,29 @@ void RrThemeFree(RrTheme *theme) static XrmDatabase loaddb(RrTheme *theme, char *name) { - XrmDatabase db; + GSList *it; + XrmDatabase db = NULL; + gchar *s; - char *s = g_build_filename(g_get_home_dir(), ".openbox", "themes", - name, "themerc", NULL); - if ((db = XrmGetFileDatabase(s))) - theme->path = g_path_get_dirname(s); - g_free(s); - if (db == NULL) { - char *s = g_build_filename(THEMEDIR, name, "themerc", NULL); + if (name[0] == '/') { + s = g_build_filename(name, "openbox-3", "themerc", NULL); if ((db = XrmGetFileDatabase(s))) theme->path = g_path_get_dirname(s); - g_free(s); + g_free(s); + } else { + for (it = parse_xdg_data_dir_paths(); !db && it; + it = g_slist_next(it)) + { + s = g_build_filename(it->data, "themes", name, + "openbox-3", "themerc", NULL); + if ((db = XrmGetFileDatabase(s))) + theme->path = g_path_get_dirname(s); + g_free(s); + } } + if (db == NULL) { - char *s = g_build_filename(name, "themerc", NULL); + s = g_build_filename(name, "themerc", NULL); if ((db = XrmGetFileDatabase(s))) theme->path = g_path_get_dirname(s); g_free(s);