summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-22 11:16:33 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-23 12:04:06 +0900
commit56c52311e5590543272b0465a750936475ad28e7 (patch)
tree37e0206e9d1ca9cbb75d234bffe07a94d0239834 /src/lib/efreet
parent24cb017626dbbb33ff545bc256008415c203cda7 (diff)
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
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_base.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c
index 689aed1ba9..d6685d7d15 100644
--- a/src/lib/efreet/efreet_base.c
+++ b/src/lib/efreet/efreet_base.c
@@ -178,8 +178,10 @@ efreet_pictures_dir_get(void)
178EAPI const char * 178EAPI const char *
179efreet_videos_dir_get(void) 179efreet_videos_dir_get(void)
180{ 180{
181 printf("0: %s\n", xdg_videos_dir);
181 if (xdg_videos_dir) return xdg_videos_dir; 182 if (xdg_videos_dir) return xdg_videos_dir;
182 xdg_videos_dir = efreet_user_dir_get("XDG_VIDEOS_DIR", _("Videos")); 183 xdg_videos_dir = efreet_user_dir_get("XDG_VIDEOS_DIR", _("Videos"));
184 printf("1: %s\n", xdg_videos_dir);
183 return xdg_videos_dir; 185 return xdg_videos_dir;
184} 186}
185 187
@@ -480,10 +482,13 @@ efreet_user_dir_get(const char *key, const char *fallback)
480 Eina_File *file = NULL; 482 Eina_File *file = NULL;
481 Eina_File_Line *line; 483 Eina_File_Line *line;
482 Eina_Iterator *it = NULL; 484 Eina_Iterator *it = NULL;
483 const char *config_home; 485 const char *config_home, *env;
484 char path[PATH_MAX]; 486 char path[PATH_MAX];
485 char *ret = NULL; 487 char *ret = NULL;
486 488
489 env = getenv(key);
490 if (env) return env;
491
487 config_home = efreet_config_home_get(); 492 config_home = efreet_config_home_get();
488 snprintf(path, sizeof(path), "%s/user-dirs.dirs", config_home); 493 snprintf(path, sizeof(path), "%s/user-dirs.dirs", config_home);
489 494