summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 17:42:23 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 17:42:23 +0000
commit1eddf879657d927c9773078bc5c88eefc6b9bc28 (patch)
tree85799c05ffc273b9b803e2faae88c97e7c58eb0c /src/bin
parent733425c62c7b9a23ad465b5b9700612fae3ee356 (diff)
downloadefl-1eddf879657d927c9773078bc5c88eefc6b9bc28.tar.gz
efl/efreet: use eina_prefix, kill one TODO item.
SVN revision: 82219
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/efreet/efreetd.c3
-rw-r--r--src/bin/efreet/efreetd_cache.c24
2 files changed, 22 insertions, 5 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index a4ae720a4e..97b516299c 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -18,7 +18,7 @@ quit(void)
}
int
-main(void)
+main(int argc, char *argv[])
{
if (!eina_init()) return 1;
efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);
@@ -28,6 +28,7 @@ main(void)
goto ecore_error;
}
if (!ecore_init()) goto ecore_error;
+ ecore_app_args_set(argc, (const char **)argv);
if (!ecore_file_init()) goto ecore_file_error;
if (!dbus_init()) goto dbus_error;
diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index 5af928bde0..db392821c3 100644
--- a/src/bin/efreet/efreetd_cache.c
+++ b/src/bin/efreet/efreetd_cache.c
@@ -22,6 +22,7 @@ static Ecore_Exe *icon_cache_exe = NULL;
static Ecore_Exe *desktop_cache_exe = NULL;
static Ecore_Timer *icon_cache_timer = NULL;
static Ecore_Timer *desktop_cache_timer = NULL;
+static Eina_Prefix *pfx = NULL;
static Eina_Bool desktop_exists = EINA_FALSE;
@@ -56,8 +57,9 @@ icon_cache_update_cache_cb(void *data EINA_UNUSED)
/* TODO: Queue if already running */
prio = ecore_exe_run_priority_get();
ecore_exe_run_priority_set(19);
- // XXX: use eina_prefix, not hard-coded prefixes
- eina_strlcpy(file, PACKAGE_LIB_DIR "/efreet/efreet_icon_cache_create", sizeof(file));
+
+ snprintf(file, sizeof(file), "%s/efreet/efreet_icon_cache_create",
+ eina_prefix_lib_get(pfx));
if (icon_extra_dirs)
{
Eina_List *ll;
@@ -118,8 +120,9 @@ desktop_cache_update_cache_cb(void *data EINA_UNUSED)
desktop_queue = EINA_FALSE;
prio = ecore_exe_run_priority_get();
ecore_exe_run_priority_set(19);
- // XXX: use eina_prefix, not hard-coded prefixes
- eina_strlcpy(file, PACKAGE_LIB_DIR "/efreet/efreet_desktop_cache_create", sizeof(file));
+
+ snprintf(file, sizeof(file), "%s/efreet/efreet/efreet_desktop_cache_create",
+ eina_prefix_lib_get(pfx));
if (desktop_extra_dirs)
{
Eina_List *ll;
@@ -497,8 +500,18 @@ cache_desktop_exists(void)
Eina_Bool
cache_init(void)
{
+ char **argv;
char buf[PATH_MAX];
+ ecore_app_args_get(NULL, &argv);
+
+ pfx = eina_prefix_new(argv[0], cache_init,
+ "EFREET", "efreet", "checkme",
+ PACKAGE_BIN_DIR,
+ PACKAGE_LIB_DIR,
+ PACKAGE_DATA_DIR,
+ PACKAGE_DATA_DIR);
+
snprintf(buf, sizeof(buf), "%s/efreet", efreet_cache_home_get());
if (!ecore_file_mkpath(buf))
{
@@ -553,6 +566,9 @@ cache_shutdown(void)
{
const char *data;
+ eina_prefix_free(pfx);
+ pfx = NULL;
+
efreet_shutdown();
if (cache_exe_del_handler) ecore_event_handler_del(cache_exe_del_handler);