efreet - fix efreet_*_dir_get() to support the xdg env vars

these api's didnt respect the env vars xdg dictates should override
the xdg dirs for that process. this fixes this and uses them if set

@fix
This commit is contained in:
Carsten Haitzler 2016-08-22 11:16:33 +09:00
parent 24cb017626
commit 56c52311e5
1 changed files with 6 additions and 1 deletions

View File

@ -178,8 +178,10 @@ efreet_pictures_dir_get(void)
EAPI const char *
efreet_videos_dir_get(void)
{
printf("0: %s\n", xdg_videos_dir);
if (xdg_videos_dir) return xdg_videos_dir;
xdg_videos_dir = efreet_user_dir_get("XDG_VIDEOS_DIR", _("Videos"));
printf("1: %s\n", xdg_videos_dir);
return xdg_videos_dir;
}
@ -480,10 +482,13 @@ efreet_user_dir_get(const char *key, const char *fallback)
Eina_File *file = NULL;
Eina_File_Line *line;
Eina_Iterator *it = NULL;
const char *config_home;
const char *config_home, *env;
char path[PATH_MAX];
char *ret = NULL;
env = getenv(key);
if (env) return env;
config_home = efreet_config_home_get();
snprintf(path, sizeof(path), "%s/user-dirs.dirs", config_home);