efreet: Add installation prefix search for XDG_DATA_DIRS.
authorAlastair Poole <netstar@gmail.com>
Thu, 3 Jan 2019 19:16:16 +0000 (19:16 +0000)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 8 Jan 2019 04:50:41 +0000 (13:50 +0900)
Summary:
Currently path parsed for XDG_DATA_DIRS is hard-coded to
/etc. By using eina_prefix_get and adding to the list
of directories efreet should use efreet will use path
relative to the EFL installation.

Reviewers: #committers, bu5hm4n, cedric, raster, zmike

Reviewed By: #committers, zmike

Subscribers: zmike, #reviewers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7534

src/lib/efreet/efreet_base.c

index 8b35285..e7bc54f 100644 (file)
@@ -305,6 +305,16 @@ efreet_dirs_init(void)
     xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", getenv("APPDATA"));
 #else
     xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", "/etc/xdg");
+
+    Eina_Stringshare *path = eina_stringshare_printf("%s/xdg", PACKAGE_SYSCONF_DIR);
+    if ((!eina_list_data_find(xdg_config_dirs, path)) && ecore_file_exists(path))
+      {
+         xdg_config_dirs = eina_list_append(xdg_config_dirs, path);
+      }
+    else
+      {
+         eina_stringshare_del(path);
+      }
 #endif
 
     /* xdg_runtime_dir */