summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/efreet/efreet.c')
-rw-r--r--src/lib/efreet/efreet.c78
1 files changed, 0 insertions, 78 deletions
diff --git a/src/lib/efreet/efreet.c b/src/lib/efreet/efreet.c
index d17e1da..091899f 100644
--- a/src/lib/efreet/efreet.c
+++ b/src/lib/efreet/efreet.c
@@ -10,8 +10,6 @@
10#include <Ecore.h> 10#include <Ecore.h>
11#include <Ecore_File.h> 11#include <Ecore_File.h>
12 12
13#include "eina_internal.h"
14
15/* define macros and variable for using the eina logging system */ 13/* define macros and variable for using the eina logging system */
16#define EFREET_MODULE_LOG_DOM /* no logging in this file */ 14#define EFREET_MODULE_LOG_DOM /* no logging in this file */
17 15
@@ -38,79 +36,6 @@ static uid_t ruid;
38static uid_t rgid; 36static uid_t rgid;
39#endif 37#endif
40 38
41static void
42_efreet_efreet_app_interface_set(void)
43{
44 char buf[PATH_MAX];
45 char *s;
46 const char *home;
47 Eina_Vpath_Interface_User user;
48
49 home = eina_vpath_resolve("(:home:)/");
50
51 memset(&user, 0, sizeof(Eina_Vpath_Interface_User));
52
53# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
54# define ENV_HOME_SET(_env, _dir, _meta) \
55 if ((getuid() != geteuid()) || (!(s = getenv(_env)))) { \
56 snprintf(buf, sizeof(buf), "%s/"_dir, home); \
57 s = buf; \
58 } \
59 (&user)->_meta = s;
60#else
61# define ENV_HOME_SET(_env, _dir, _meta) \
62 if (!(s = getenv(_env))) { \
63 snprintf(buf, sizeof(buf), "%s/"_dir, home); \
64 s = buf; \
65 } \
66 (&user)->_meta = s;
67#endif
68 // $XDG_DESKTOP_DIR="$HOME/Desktop"
69 ENV_HOME_SET("XDG_DESKTOP_DIR", "Desktop", desktop);
70 // $XDG_DOCUMENTS_DIR="$HOME/Documents"
71 ENV_HOME_SET("XDG_DOCUMENTS_DIR", "Documents", documents);
72 // $XDG_DOWNLOAD_DIR="$HOME/Downloads"
73 ENV_HOME_SET("XDG_DOWNLOAD_DIR", "Downloads", downloads);
74 // $XDG_MUSIC_DIR="$HOME/Music"
75 ENV_HOME_SET("XDG_MUSIC_DIR", "Music", music);
76 // $XDG_PICTURES_DIR="$HOME/Pictures"
77 ENV_HOME_SET("XDG_PICTURES_DIR", "Pictures", pictures);
78 // $XDG_PUBLICSHARE_DIR="$HOME/Public"
79 ENV_HOME_SET("XDG_PUBLIC_DIR", "Public", pub);
80 // $XDG_TEMPLATES_DIR="$HOME/.Templates"
81 ENV_HOME_SET("XDG_TEMPLATES_DIR", ".Templates", templates);
82 // $XDG_VIDEOS_DIR="$HOME/Videos"
83 ENV_HOME_SET("XDG_VIDEOS_DIR", "Videos", videos);
84 // $XDG_DATA_HOME defines the base directory relative to which user
85 // specific data files should be stored. If $XDG_DATA_HOME is either
86 // not set or empty, a default equal to $HOME/.local/share should be
87 // used.
88 ENV_HOME_SET("XDG_DATA_HOME", ".local/share", data);
89 ENV_HOME_SET("XDG_TMP_HOME", ".local/tmp", tmp);
90 // $XDG_CONFIG_HOME defines the base directory relative to which user
91 // specific configuration files should be stored. If $XDG_CONFIG_HOME
92 // is either not set or empty, a default equal to $HOME/.config should
93 // be used.
94 ENV_HOME_SET("XDG_CONFIG_HOME", ".config", config);
95 // $XDG_CACHE_HOME defines the base directory relative to which
96 // user specific non-essential data files should be stored. If
97 // $XDG_CACHE_HOME is either not set or empty, a default equal to
98 // $HOME/.cache should be used.
99 ENV_HOME_SET("XDG_CACHE_HOME", ".cache", cache);
100
101#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
102 if ((getuid() != geteuid()) || (!(s = getenv("XDG_RUNTIME_DIR"))))
103#else
104 if (!(s = getenv("XDG_RUNTIME_DIR")))
105#endif
106 user.run = NULL;
107 else
108 user.run = s;
109
110 eina_vpath_interface_user_set(&user);
111}
112
113
114EAPI int 39EAPI int
115efreet_init(void) 40efreet_init(void)
116{ 41{
@@ -145,9 +70,6 @@ efreet_init(void)
145 if (!ecore_file_init()) 70 if (!ecore_file_init())
146 goto shutdown_ecore; 71 goto shutdown_ecore;
147 72
148 //this needs to be early initializied efreet itself is using vpaths
149 _efreet_efreet_app_interface_set();
150
151 if (!efreet_base_init()) 73 if (!efreet_base_init())
152 goto shutdown_ecore_file; 74 goto shutdown_ecore_file;
153 75