aboutsummaryrefslogtreecommitdiffstats
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
parent733425c62c7b9a23ad465b5b9700612fae3ee356 (diff)
downloadefl-1eddf879657d927c9773078bc5c88eefc6b9bc28.tar.gz
efl-1eddf879657d927c9773078bc5c88eefc6b9bc28.tar.xz
efl-1eddf879657d927c9773078bc5c88eefc6b9bc28.zip
efl/efreet: use eina_prefix, kill one TODO item.
SVN revision: 82219
-rw-r--r--data/Makefile.am5
-rw-r--r--data/efreet/checkme2
-rw-r--r--src/Makefile_Efreet.am1
-rw-r--r--src/bin/efreet/efreetd.c3
-rw-r--r--src/bin/efreet/efreetd_cache.c24
5 files changed, 30 insertions, 5 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 40efb046d..890970c73 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -23,6 +23,11 @@ ecoreimffilesdir = $(datadir)/ecore_imf
ecoreimffiles_DATA = ecore_imf/checkme
########################################################################
+# Efreet
+efreetfilesdir = $(datadir)/efreet
+efreetfiles_DATA = efreet/checkme
+
+########################################################################
# Eo
eofilesdir = $(datadir)/eo
eofiles_DATA = eo/eo_step.py
diff --git a/data/efreet/checkme b/data/efreet/checkme
new file mode 100644
index 000000000..82eac5872
--- /dev/null
+++ b/data/efreet/checkme
@@ -0,0 +1,2 @@
+This is just a test file used to help efreet determine its prefix
+location.
diff --git a/src/Makefile_Efreet.am b/src/Makefile_Efreet.am
index d707150e9..2aff77f94 100644
--- a/src/Makefile_Efreet.am
+++ b/src/Makefile_Efreet.am
@@ -21,6 +21,7 @@ EFREET_COMMON_CPPFLAGS = \
-I$(top_builddir)/src/lib/edbus \
-I$(top_srcdir)/src/lib/efreet \
-I$(top_builddir)/src/lib/efreet \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)\" \
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index a4ae720a4..97b516299 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 5af928bde..db392821c 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);