summaryrefslogtreecommitdiff
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)
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 40efb04..890970c 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -23,6 +23,11 @@ ecoreimffilesdir = $(datadir)/ecore_imf
23ecoreimffiles_DATA = ecore_imf/checkme 23ecoreimffiles_DATA = ecore_imf/checkme
24 24
25######################################################################## 25########################################################################
26# Efreet
27efreetfilesdir = $(datadir)/efreet
28efreetfiles_DATA = efreet/checkme
29
30########################################################################
26# Eo 31# Eo
27eofilesdir = $(datadir)/eo 32eofilesdir = $(datadir)/eo
28eofiles_DATA = eo/eo_step.py 33eofiles_DATA = eo/eo_step.py
diff --git a/data/efreet/checkme b/data/efreet/checkme
new file mode 100644
index 0000000..82eac58
--- /dev/null
+++ b/data/efreet/checkme
@@ -0,0 +1,2 @@
1This is just a test file used to help efreet determine its prefix
2location.
diff --git a/src/Makefile_Efreet.am b/src/Makefile_Efreet.am
index d707150..2aff77f 100644
--- a/src/Makefile_Efreet.am
+++ b/src/Makefile_Efreet.am
@@ -21,6 +21,7 @@ EFREET_COMMON_CPPFLAGS = \
21-I$(top_builddir)/src/lib/edbus \ 21-I$(top_builddir)/src/lib/edbus \
22-I$(top_srcdir)/src/lib/efreet \ 22-I$(top_srcdir)/src/lib/efreet \
23-I$(top_builddir)/src/lib/efreet \ 23-I$(top_builddir)/src/lib/efreet \
24-DPACKAGE_BIN_DIR=\"$(bindir)\" \
24-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 25-DPACKAGE_LIB_DIR=\"$(libdir)\" \
25-DPACKAGE_DATA_DIR=\"$(datadir)\" \ 26-DPACKAGE_DATA_DIR=\"$(datadir)\" \
26-DLOCALE_DIR=\"@LOCALE_DIR@\" \ 27-DLOCALE_DIR=\"@LOCALE_DIR@\" \
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index a4ae720..97b5162 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -18,7 +18,7 @@ quit(void)
18} 18}
19 19
20int 20int
21main(void) 21main(int argc, char *argv[])
22{ 22{
23 if (!eina_init()) return 1; 23 if (!eina_init()) return 1;
24 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR); 24 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);
@@ -28,6 +28,7 @@ main(void)
28 goto ecore_error; 28 goto ecore_error;
29 } 29 }
30 if (!ecore_init()) goto ecore_error; 30 if (!ecore_init()) goto ecore_error;
31 ecore_app_args_set(argc, (const char **)argv);
31 if (!ecore_file_init()) goto ecore_file_error; 32 if (!ecore_file_init()) goto ecore_file_error;
32 33
33 if (!dbus_init()) goto dbus_error; 34 if (!dbus_init()) goto dbus_error;
diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index 5af928b..db39282 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;
22static Ecore_Exe *desktop_cache_exe = NULL; 22static Ecore_Exe *desktop_cache_exe = NULL;
23static Ecore_Timer *icon_cache_timer = NULL; 23static Ecore_Timer *icon_cache_timer = NULL;
24static Ecore_Timer *desktop_cache_timer = NULL; 24static Ecore_Timer *desktop_cache_timer = NULL;
25static Eina_Prefix *pfx = NULL;
25 26
26static Eina_Bool desktop_exists = EINA_FALSE; 27static Eina_Bool desktop_exists = EINA_FALSE;
27 28
@@ -56,8 +57,9 @@ icon_cache_update_cache_cb(void *data EINA_UNUSED)
56 /* TODO: Queue if already running */ 57 /* TODO: Queue if already running */
57 prio = ecore_exe_run_priority_get(); 58 prio = ecore_exe_run_priority_get();
58 ecore_exe_run_priority_set(19); 59 ecore_exe_run_priority_set(19);
59 // XXX: use eina_prefix, not hard-coded prefixes 60
60 eina_strlcpy(file, PACKAGE_LIB_DIR "/efreet/efreet_icon_cache_create", sizeof(file)); 61 snprintf(file, sizeof(file), "%s/efreet/efreet_icon_cache_create",
62 eina_prefix_lib_get(pfx));
61 if (icon_extra_dirs) 63 if (icon_extra_dirs)
62 { 64 {
63 Eina_List *ll; 65 Eina_List *ll;
@@ -118,8 +120,9 @@ desktop_cache_update_cache_cb(void *data EINA_UNUSED)
118 desktop_queue = EINA_FALSE; 120 desktop_queue = EINA_FALSE;
119 prio = ecore_exe_run_priority_get(); 121 prio = ecore_exe_run_priority_get();
120 ecore_exe_run_priority_set(19); 122 ecore_exe_run_priority_set(19);
121 // XXX: use eina_prefix, not hard-coded prefixes 123
122 eina_strlcpy(file, PACKAGE_LIB_DIR "/efreet/efreet_desktop_cache_create", sizeof(file)); 124 snprintf(file, sizeof(file), "%s/efreet/efreet/efreet_desktop_cache_create",
125 eina_prefix_lib_get(pfx));
123 if (desktop_extra_dirs) 126 if (desktop_extra_dirs)
124 { 127 {
125 Eina_List *ll; 128 Eina_List *ll;
@@ -497,8 +500,18 @@ cache_desktop_exists(void)
497Eina_Bool 500Eina_Bool
498cache_init(void) 501cache_init(void)
499{ 502{
503 char **argv;
500 char buf[PATH_MAX]; 504 char buf[PATH_MAX];
501 505
506 ecore_app_args_get(NULL, &argv);
507
508 pfx = eina_prefix_new(argv[0], cache_init,
509 "EFREET", "efreet", "checkme",
510 PACKAGE_BIN_DIR,
511 PACKAGE_LIB_DIR,
512 PACKAGE_DATA_DIR,
513 PACKAGE_DATA_DIR);
514
502 snprintf(buf, sizeof(buf), "%s/efreet", efreet_cache_home_get()); 515 snprintf(buf, sizeof(buf), "%s/efreet", efreet_cache_home_get());
503 if (!ecore_file_mkpath(buf)) 516 if (!ecore_file_mkpath(buf))
504 { 517 {
@@ -553,6 +566,9 @@ cache_shutdown(void)
553{ 566{
554 const char *data; 567 const char *data;
555 568
569 eina_prefix_free(pfx);
570 pfx = NULL;
571
556 efreet_shutdown(); 572 efreet_shutdown();
557 573
558 if (cache_exe_del_handler) ecore_event_handler_del(cache_exe_del_handler); 574 if (cache_exe_del_handler) ecore_event_handler_del(cache_exe_del_handler);