From cb250d490c14872f03bb0320179e48d05fe2539d Mon Sep 17 00:00:00 2001 From: Kenneth Zhou Date: Wed, 18 Jun 2014 19:55:40 -0400 Subject: Basic xdg directory implementation Search $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS for config files. This also negates the need to have separate user and global variants of mp_find_config_file() Closes #864, #109. Signed-off-by: wm4 --- sub/ass_mp.c | 4 ++-- sub/find_subfiles.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sub') diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 02172605d5..0609351f7b 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -177,7 +177,7 @@ void mp_ass_configure_fonts(ASS_Renderer *priv, struct osd_style_opts *opts, struct mpv_global *global, struct mp_log *log) { void *tmp = talloc_new(NULL); - char *default_font = mp_find_user_config_file(tmp, global, "subfont.ttf"); + char *default_font = mp_find_config_file(tmp, global, "subfont.ttf"); char *config = mp_find_config_file(tmp, global, "fonts.conf"); if (default_font && !mp_path_exists(default_font)) @@ -249,7 +249,7 @@ static void message_callback(int level, const char *format, va_list va, void *ct ASS_Library *mp_ass_init(struct mpv_global *global, struct mp_log *log) { - char *path = mp_find_user_config_file(NULL, global, "fonts"); + char *path = mp_find_config_file(NULL, global, "fonts"); ASS_Library *priv = ass_library_init(); if (!priv) abort(); diff --git a/sub/find_subfiles.c b/sub/find_subfiles.c index a8d6348fe9..9313bf379d 100644 --- a/sub/find_subfiles.c +++ b/sub/find_subfiles.c @@ -242,7 +242,7 @@ struct subfn *find_text_subtitles(struct mpv_global *global, const char *fname) } // Load subtitles in ~/.mpv/sub limiting sub fuzziness - char *mp_subdir = mp_find_user_config_file(NULL, global, "sub/"); + char *mp_subdir = mp_find_config_file(NULL, global, "sub/"); if (mp_subdir) append_dir_subtitles(global, &slist, &n, bstr0(mp_subdir), fname, 1); talloc_free(mp_subdir); -- cgit v1.2.3