summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac8
-rw-r--r--dbus-services/org.enlightenment.Efreet.service.in4
-rw-r--r--src/Makefile_Efreet.am7
-rw-r--r--src/bin/efreet/efreetd.c10
-rw-r--r--src/bin/efreet/efreetd_cache.c2
-rw-r--r--src/bin/efreet/efreetd_dbus.c262
-rw-r--r--src/bin/efreet/efreetd_ipc.c226
-rw-r--r--src/bin/efreet/efreetd_ipc.h (renamed from src/bin/efreet/efreetd_dbus.h)8
-rw-r--r--src/lib/efreet/efreet_cache.c415
-rw-r--r--systemd-services/efreet.service.in7
11 files changed, 461 insertions, 490 deletions
diff --git a/Makefile.am b/Makefile.am
index d02db5e5b7..e172405033 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -383,13 +383,11 @@ cmakeconfig/EmileConfigVersion.cmake
383 383
384servicedir = @dbusservicedir@ 384servicedir = @dbusservicedir@
385service_DATA = \ 385service_DATA = \
386dbus-services/org.enlightenment.Efreet.service \
387dbus-services/org.enlightenment.Ethumb.service 386dbus-services/org.enlightenment.Ethumb.service
388 387
389if HAVE_SYSTEMD_USER_SESSION 388if HAVE_SYSTEMD_USER_SESSION
390systemdunitsdir = @USER_SESSION_DIR@ 389systemdunitsdir = @USER_SESSION_DIR@
391systemdunits_DATA = \ 390systemdunits_DATA = \
392systemd-services/efreet.service \
393systemd-services/ethumb.service 391systemd-services/ethumb.service
394endif 392endif
395EXTRA_DIST += $(systemdunits_DATA) 393EXTRA_DIST += $(systemdunits_DATA)
diff --git a/configure.ac b/configure.ac
index 1673471d91..8ed4d1bb64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4121,10 +4121,10 @@ EFL_PLATFORM_DEPEND([EFREET], [evil])
4121EFL_INTERNAL_DEPEND_PKG([EFREET], [eet]) 4121EFL_INTERNAL_DEPEND_PKG([EFREET], [eet])
4122EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore]) 4122EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore])
4123EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore-file]) 4123EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore-file])
4124EFL_INTERNAL_DEPEND_PKG([EFREET], [eldbus])
4125EFL_INTERNAL_DEPEND_PKG([EFREET], [eo]) 4124EFL_INTERNAL_DEPEND_PKG([EFREET], [eo])
4126EFL_INTERNAL_DEPEND_PKG([EFREET], [eina]) 4125EFL_INTERNAL_DEPEND_PKG([EFREET], [eina])
4127EFL_INTERNAL_DEPEND_PKG([EFREET], [emile]) 4126EFL_INTERNAL_DEPEND_PKG([EFREET], [emile])
4127EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore-ipc])
4128 4128
4129### Checks for header files 4129### Checks for header files
4130 4130
@@ -4755,9 +4755,7 @@ pc/ethumb.pc
4755pc/ethumb_client.pc 4755pc/ethumb_client.pc
4756pc/elocation.pc 4756pc/elocation.pc
4757pc/elua.pc 4757pc/elua.pc
4758dbus-services/org.enlightenment.Efreet.service
4759dbus-services/org.enlightenment.Ethumb.service 4758dbus-services/org.enlightenment.Ethumb.service
4760systemd-services/efreet.service
4761systemd-services/ethumb.service 4759systemd-services/ethumb.service
4762$po_makefile_in 4760$po_makefile_in
4763cmakeconfig/EflConfig.cmake 4761cmakeconfig/EflConfig.cmake
@@ -5261,25 +5259,21 @@ if test "x$prefix" != "x/usr"; then
5261 echo "" 5259 echo ""
5262 echo "System-wide installation:" 5260 echo "System-wide installation:"
5263 echo " ln -s ${resolved_dbusservicedir}/org.enlightenment.Ethumb.service /usr/share/dbus-1/services/org.enlightenment.Ethumb.service" 5261 echo " ln -s ${resolved_dbusservicedir}/org.enlightenment.Ethumb.service /usr/share/dbus-1/services/org.enlightenment.Ethumb.service"
5264 echo " ln -s ${resolved_dbusservicedir}/org.enlightenment.Efreet.service /usr/share/dbus-1/services/org.enlightenment.Efreet.service"
5265 echo "" 5262 echo ""
5266 echo " or add \"${resolved_datadir}\" to \$XDG_DATA_DIRS" 5263 echo " or add \"${resolved_datadir}\" to \$XDG_DATA_DIRS"
5267 echo "" 5264 echo ""
5268 echo "User installation:" 5265 echo "User installation:"
5269 echo " ln -s ${resolved_dbusservicedir}/org.enlightenment.Ethumb.service ~/.local/share/dbus-1/services/org.enlightenment.Ethumb.service" 5266 echo " ln -s ${resolved_dbusservicedir}/org.enlightenment.Ethumb.service ~/.local/share/dbus-1/services/org.enlightenment.Ethumb.service"
5270 echo " ln -s ${resolved_dbusservicedir}/org.enlightenment.Efreet.service ~/.local/share/dbus-1/services/org.enlightenment.Efreet.service"
5271 fi 5267 fi
5272 if test $needs_alert_systemd -eq 1; then 5268 if test $needs_alert_systemd -eq 1; then
5273 echo "" 5269 echo ""
5274 echo "System-wide installation:" 5270 echo "System-wide installation:"
5275 echo " ln -s ${resolved_USER_SESSION_DIR}/ethumb.service /usr/lib/systemd/user/ethumb.service" 5271 echo " ln -s ${resolved_USER_SESSION_DIR}/ethumb.service /usr/lib/systemd/user/ethumb.service"
5276 echo " ln -s ${resolved_USER_SESSION_DIR}/efreet.service /usr/lib/systemd/user/efreet.service"
5277 echo "" 5272 echo ""
5278 echo " or add \"${base_USER_SESSION_DIR}\" to \$XDG_DATA_DIRS or \$XDG_CONFIG_DIRS" 5273 echo " or add \"${base_USER_SESSION_DIR}\" to \$XDG_DATA_DIRS or \$XDG_CONFIG_DIRS"
5279 echo "" 5274 echo ""
5280 echo "User installation:" 5275 echo "User installation:"
5281 echo " ln -s ${resolved_USER_SESSION_DIR}/ethumb.service ~/.config/systemd/user/ethumb.service" 5276 echo " ln -s ${resolved_USER_SESSION_DIR}/ethumb.service ~/.config/systemd/user/ethumb.service"
5282 echo " ln -s ${resolved_USER_SESSION_DIR}/efreet.service ~/.config/systemd/user/efreet.service"
5283 fi 5277 fi
5284 echo "" 5278 echo ""
5285 echo "#-------------------------------------------------------------------#" 5279 echo "#-------------------------------------------------------------------#"
diff --git a/dbus-services/org.enlightenment.Efreet.service.in b/dbus-services/org.enlightenment.Efreet.service.in
deleted file mode 100644
index 5eb5d5326b..0000000000
--- a/dbus-services/org.enlightenment.Efreet.service.in
+++ /dev/null
@@ -1,4 +0,0 @@
1[D-BUS Service]
2Name=org.enlightenment.Efreet
3Exec=@prefix@/bin/efreetd
4@systemd_dbus_prefix@SystemdService=efreet.service
diff --git a/src/Makefile_Efreet.am b/src/Makefile_Efreet.am
index 4ff3aecdf7..092ca77568 100644
--- a/src/Makefile_Efreet.am
+++ b/src/Makefile_Efreet.am
@@ -78,8 +78,8 @@ bin_PROGRAMS += bin/efreet/efreetd
78bin_efreet_efreetd_SOURCES = \ 78bin_efreet_efreetd_SOURCES = \
79bin/efreet/efreetd.c \ 79bin/efreet/efreetd.c \
80bin/efreet/efreetd.h \ 80bin/efreet/efreetd.h \
81bin/efreet/efreetd_dbus.h \ 81bin/efreet/efreetd_ipc.h \
82bin/efreet/efreetd_dbus.c \ 82bin/efreet/efreetd_ipc.c \
83bin/efreet/efreetd_cache.h \ 83bin/efreet/efreetd_cache.h \
84bin/efreet/efreetd_cache.c 84bin/efreet/efreetd_cache.c
85 85
@@ -206,8 +206,7 @@ efreettestsub_DATA = \
206tests/efreet/data/sub/test.desktop 206tests/efreet/data/sub/test.desktop
207 207
208check_PROGRAMS += tests/efreet/efreet_suite 208check_PROGRAMS += tests/efreet/efreet_suite
209# Need to run with dbus-launch - disable for now 209TESTS += tests/efreet/efreet_suite
210#TESTS += tests/efreet/efreet_suite
211 210
212tests_efreet_efreet_suite_SOURCES = \ 211tests_efreet_efreet_suite_SOURCES = \
213tests/efreet/efreet_suite.c \ 212tests/efreet/efreet_suite.c \
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index 1661ec293b..ffb15a09c3 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -12,8 +12,8 @@
12#include <Ecore_File.h> 12#include <Ecore_File.h>
13 13
14#include "efreetd.h" 14#include "efreetd.h"
15#include "efreetd_dbus.h"
16#include "efreetd_cache.h" 15#include "efreetd_cache.h"
16#include "efreetd_ipc.h"
17 17
18int efreetd_log_dom = -1; 18int efreetd_log_dom = -1;
19 19
@@ -61,13 +61,13 @@ main(int argc, char *argv[])
61 if (!ecore_init()) goto ecore_error; 61 if (!ecore_init()) goto ecore_error;
62 ecore_app_args_set(argc, (const char **)argv); 62 ecore_app_args_set(argc, (const char **)argv);
63 if (!ecore_file_init()) goto ecore_file_error; 63 if (!ecore_file_init()) goto ecore_file_error;
64 if (!dbus_init()) goto dbus_error; 64 if (!ipc_init()) goto ipc_error;
65 if (!cache_init()) goto cache_error; 65 if (!cache_init()) goto cache_error;
66 66
67 ecore_main_loop_begin(); 67 ecore_main_loop_begin();
68 68
69 cache_shutdown(); 69 cache_shutdown();
70 dbus_shutdown(); 70 ipc_shutdown();
71 ecore_file_shutdown(); 71 ecore_file_shutdown();
72 ecore_shutdown(); 72 ecore_shutdown();
73 eina_log_domain_unregister(efreetd_log_dom); 73 eina_log_domain_unregister(efreetd_log_dom);
@@ -76,8 +76,8 @@ main(int argc, char *argv[])
76 return 0; 76 return 0;
77 77
78cache_error: 78cache_error:
79 dbus_shutdown(); 79 ipc_shutdown();
80dbus_error: 80ipc_error:
81 ecore_file_shutdown(); 81 ecore_file_shutdown();
82ecore_file_error: 82ecore_file_error:
83 ecore_shutdown(); 83 ecore_shutdown();
diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index a4887e6841..a2ef783db8 100644
--- a/src/bin/efreet/efreetd_cache.c
+++ b/src/bin/efreet/efreetd_cache.c
@@ -7,7 +7,7 @@
7#include <Ecore_File.h> 7#include <Ecore_File.h>
8#include <Eet.h> 8#include <Eet.h>
9#include "efreetd.h" 9#include "efreetd.h"
10#include "efreetd_dbus.h" 10#include "efreetd_ipc.h"
11 11
12#include "Efreet.h" 12#include "Efreet.h"
13#define EFREET_MODULE_LOG_DOM efreetd_log_dom 13#define EFREET_MODULE_LOG_DOM efreetd_log_dom
diff --git a/src/bin/efreet/efreetd_dbus.c b/src/bin/efreet/efreetd_dbus.c
deleted file mode 100644
index 82a66c179f..0000000000
--- a/src/bin/efreet/efreetd_dbus.c
+++ /dev/null
@@ -1,262 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore.h>
6#include <Eldbus.h>
7
8#include "efreetd.h"
9#include "efreetd_cache.h"
10
11#define BUS "org.enlightenment.Efreet"
12#define PATH "/org/enlightenment/Efreet"
13#define INTERFACE "org.enlightenment.Efreet"
14
15/* internal */
16enum
17{
18 EFREET_SIGNAL_ICON_CACHE_UPDATE = 0,
19 EFREET_SIGNAL_DESKTOP_CACHE_UPDATE
20};
21
22static Eldbus_Connection *conn;
23static Eldbus_Service_Interface *iface;
24
25static Ecore_Timer *_shutdown = NULL;
26static int clients = 0;
27
28static Eina_Bool
29do_shutdown(void *data EINA_UNUSED)
30{
31 quit();
32 return ECORE_CALLBACK_CANCEL;
33}
34
35static void
36disconnected(void *context EINA_UNUSED, Eldbus_Connection *connection EINA_UNUSED, void *event_info EINA_UNUSED)
37{
38 INF("disconnected");
39 quit();
40}
41
42static void
43client_name_owner_changed_cb(void *data EINA_UNUSED, const char *bus, const char *old_id EINA_UNUSED, const char *new_id)
44{
45 if (new_id[0])
46 return;
47 eldbus_name_owner_changed_callback_del(conn, bus,
48 client_name_owner_changed_cb, NULL);
49 clients--;
50 if (clients <= 0)
51 {
52 clients = 0;
53 if (_shutdown) ecore_timer_del(_shutdown);
54 _shutdown = ecore_timer_add(10.0, do_shutdown, NULL);
55 }
56}
57
58static Eldbus_Message *
59do_register(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
60{
61 Eldbus_Message *reply;
62 const char *lang;
63
64 if (!eldbus_message_arguments_get(message, "s", &lang))
65 {
66 ERR("Error getting arguments.");
67 return NULL;
68 }
69 setenv("LANG", lang, 1);
70
71 clients++;
72 if (_shutdown) ecore_timer_del(_shutdown);
73 _shutdown = NULL;
74
75 eldbus_name_owner_changed_callback_add(conn,
76 eldbus_message_sender_get(message),
77 client_name_owner_changed_cb, NULL,
78 EINA_FALSE);
79 reply = eldbus_message_method_return_new(message);
80 eldbus_message_arguments_append(reply, "b", cache_desktop_exists());
81 return reply;
82}
83
84static Eldbus_Message *
85add_desktop_dirs(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
86{
87 Eldbus_Message_Iter *array = NULL;
88 const char *dir;
89
90 if (!eldbus_message_arguments_get(message, "as", &array))
91 {
92 ERR("Error getting arguments.");
93 return NULL;
94 }
95
96 while (eldbus_message_iter_get_and_next(array, 's', &dir))
97 {
98 cache_desktop_dir_add(dir);
99 }
100
101 return NULL;
102}
103
104static Eldbus_Message *
105add_icon_dirs(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
106{
107 Eldbus_Message_Iter *array = NULL;
108 const char *dir;
109
110 if (!eldbus_message_arguments_get(message, "as", &array))
111 {
112 ERR("Error getting arguments.");
113 return NULL;
114 }
115
116 while (eldbus_message_iter_get_and_next(array, 's', &dir))
117 {
118 cache_icon_dir_add(dir);
119 }
120
121 return NULL;
122}
123
124static Eldbus_Message *
125build_desktop_cache(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message EINA_UNUSED)
126{
127 const char *lang;
128
129 if (!eldbus_message_arguments_get(message, "s", &lang))
130 {
131 ERR("Error getting arguments.");
132 return NULL;
133 }
134 setenv("LANG", lang, 1);
135
136 cache_desktop_update();
137 return NULL;
138}
139
140static Eldbus_Message *
141add_icon_exts(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
142{
143 Eldbus_Message_Iter *array = NULL;
144 const char *ext;
145
146 if (!eldbus_message_arguments_get(message, "as", &array))
147 {
148 ERR("Error getting arguments.");
149 return NULL;
150 }
151
152 while (eldbus_message_iter_get_and_next(array, 's', &ext))
153 {
154 cache_icon_ext_add(ext);
155 }
156
157 return NULL;
158}
159
160static const Eldbus_Signal signals[] = {
161 [EFREET_SIGNAL_ICON_CACHE_UPDATE] = {"IconCacheUpdate", ELDBUS_ARGS({ "b", "update" }), 0},
162 [EFREET_SIGNAL_DESKTOP_CACHE_UPDATE] = {"DesktopCacheUpdate", ELDBUS_ARGS({ "b", "update" }), 0},
163 { NULL, NULL, 0 }
164};
165
166static const Eldbus_Method methods[] = {
167 {
168 "Register", ELDBUS_ARGS({"s", "lang info"}), ELDBUS_ARGS({"b", "cache exists"}),
169 do_register, 0
170 },
171 {
172 "AddDesktopDirs", ELDBUS_ARGS({"as", "dirs"}), NULL,
173 add_desktop_dirs, ELDBUS_METHOD_FLAG_NOREPLY
174 },
175 {
176 "BuildDesktopCache", ELDBUS_ARGS({"s", "lang info"}), NULL,
177 build_desktop_cache, ELDBUS_METHOD_FLAG_NOREPLY
178 },
179 {
180 "AddIconDirs", ELDBUS_ARGS({"as", "dirs"}), NULL,
181 add_icon_dirs, ELDBUS_METHOD_FLAG_NOREPLY
182 },
183 {
184 "AddIconExts", ELDBUS_ARGS({"as", "exts"}), NULL,
185 add_icon_exts, ELDBUS_METHOD_FLAG_NOREPLY
186 },
187 { NULL, NULL, NULL, NULL, 0 }
188};
189
190static const Eldbus_Service_Interface_Desc desc = {
191 INTERFACE, methods, signals, NULL, NULL, NULL
192};
193
194static void
195on_name_request(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
196{
197 unsigned int reply;
198
199 if (eldbus_message_error_get(msg, NULL, NULL))
200 {
201 ERR("error on on_name_request");
202 quit();
203 return;
204 }
205
206 if (!eldbus_message_arguments_get(msg, "u", &reply))
207 {
208 ERR("error getting arguments on on_name_request");
209 quit();
210 return;
211 }
212
213 if (reply != ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
214 {
215 ERR("error name already in use");
216 quit();
217 return;
218 }
219 INF("name requested");
220}
221
222/* external */
223void
224send_signal_icon_cache_update(Eina_Bool update)
225{
226 eldbus_service_signal_emit(iface, EFREET_SIGNAL_ICON_CACHE_UPDATE, update);
227}
228
229void
230send_signal_desktop_cache_update(Eina_Bool update)
231{
232 eldbus_service_signal_emit(iface, EFREET_SIGNAL_DESKTOP_CACHE_UPDATE, update);
233}
234
235Eina_Bool
236dbus_init(void)
237{
238 if (!eldbus_init()) return EINA_FALSE;
239
240 conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
241 if (!conn) goto conn_error;
242
243 eldbus_connection_event_callback_add(conn,
244 ELDBUS_CONNECTION_EVENT_DISCONNECTED, disconnected, NULL);
245 iface = eldbus_service_interface_register(conn, PATH, &desc);
246 eldbus_name_request(conn, BUS, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
247 on_name_request, NULL);
248
249 return EINA_TRUE;
250conn_error:
251 eldbus_shutdown();
252 return EINA_FALSE;
253}
254
255Eina_Bool
256dbus_shutdown(void)
257{
258 eldbus_connection_unref(conn);
259 eldbus_shutdown();
260 return EINA_TRUE;
261
262}
diff --git a/src/bin/efreet/efreetd_ipc.c b/src/bin/efreet/efreetd_ipc.c
new file mode 100644
index 0000000000..7b918d4713
--- /dev/null
+++ b/src/bin/efreet/efreetd_ipc.c
@@ -0,0 +1,226 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore.h>
6#include <Ecore_Ipc.h>
7
8#include "efreetd.h"
9#include "efreetd_cache.h"
10
11static int init = 0;
12static Ecore_Ipc_Server *ipc = NULL;
13static Ecore_Event_Handler *hnd_add = NULL;
14static Ecore_Event_Handler *hnd_del = NULL;
15static Ecore_Event_Handler *hnd_data = NULL;
16static int clients = 0;
17static Ecore_Timer *quit_timer = NULL;
18
19static Eina_Bool
20_cb_quit_timer(void *data EINA_UNUSED)
21{
22 quit_timer = NULL;
23 quit();
24 return EINA_FALSE;
25}
26
27static void
28_broadcast(Ecore_Ipc_Server *svr, int major, int minor, void *data, int size)
29{
30 Eina_List *clients = ecore_ipc_server_clients_get(svr);
31 Eina_List *l;
32 Ecore_Ipc_Client *cl;
33
34 EINA_LIST_FOREACH(clients, l, cl)
35 {
36 ecore_ipc_client_send(cl, major, minor, 0, 0, 0, data, size);
37 }
38}
39
40static char *
41_parse_str(void *data, int size)
42{
43 char *str = malloc(size + 1);
44 if (!str) return NULL;
45 memcpy(str, data, size);
46 str[size] = 0;
47 return str;
48}
49
50static Eina_List *
51_parse_strs(void *data, int size)
52{
53 Eina_List *list = NULL;
54 char *p, *p0 = NULL, *p1 = NULL, *e = (char *)data + size;
55
56 for (p = data; p < e; p++)
57 {
58 if (!p0)
59 {
60 if (*p)
61 {
62 p0 = p;
63 p1 = e;
64 }
65 }
66 if (!*p)
67 {
68 p1 = strdup(p0);
69 if (p1) list = eina_list_append(list, p1);
70 p0 = NULL;
71 }
72 }
73 if (p0)
74 {
75 p = malloc(p1 - p0 + 1);
76 if (p)
77 {
78 memcpy(p, p0, p1 - p0);
79 p[p1 - p0] = 0;
80 list = eina_list_append(list, p);
81 }
82 }
83 return list;
84}
85
86#define IPC_HEAD(_type) \
87 Ecore_Ipc_Event_Client_##_type *e = event; \
88 if (ecore_ipc_client_server_get(e->client) != ipc) \
89 return ECORE_CALLBACK_PASS_ON
90
91static Eina_Bool
92_cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
93{
94 IPC_HEAD(Add);
95 if (quit_timer)
96 {
97 ecore_timer_del(quit_timer);
98 quit_timer = NULL;
99 }
100 clients++;
101 return ECORE_CALLBACK_DONE;
102}
103
104static Eina_Bool
105_cb_client_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
106{
107 IPC_HEAD(Del);
108 clients--;
109 if (clients == 0)
110 {
111 if (quit_timer) ecore_timer_del(quit_timer);
112 quit_timer = ecore_timer_add(10.0, _cb_quit_timer, NULL);
113 }
114 return ECORE_CALLBACK_DONE;
115}
116
117static Eina_Bool
118_cb_client_data(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
119{
120 Eina_List *strs;
121 char *s;
122 IPC_HEAD(Data);
123 if (e->major == 1) // register lang
124 { // input: str -> lang
125 if ((s = _parse_str(e->data, e->size)))
126 {
127 setenv("LANG", s, 1);
128 free(s);
129 }
130 // return if desktop cache exists (bool as minor)
131 ecore_ipc_client_send(e->client, 1 /* register reply */,
132 cache_desktop_exists(), 0, 0, 0, NULL, 0);
133 }
134 else if (e->major == 2) // add desktop dirs
135 { // input: array of str -> dirs
136 strs = _parse_strs(e->data, e->size);
137 EINA_LIST_FREE(strs, s)
138 {
139 cache_desktop_dir_add(s);
140 free(s);
141 }
142 }
143 else if (e->major == 3) // build desktop cache
144 { // input: str -> lang
145 if ((s = _parse_str(e->data, e->size)))
146 {
147 setenv("LANG", s, 1);
148 free(s);
149 }
150 cache_desktop_update();
151 }
152 else if (e->major == 4) // add icon dirs
153 { // input: array of str -> dirs
154 strs = _parse_strs(e->data, e->size);
155 EINA_LIST_FREE(strs, s)
156 {
157 cache_icon_dir_add(s);
158 free(s);
159 }
160 }
161 else if (e->major == 5) // add icon exts
162 { // input: array of str -> exts
163 strs = _parse_strs(e->data, e->size);
164 EINA_LIST_FREE(strs, s)
165 {
166 cache_icon_ext_add(s);
167 free(s);
168 }
169 }
170 return ECORE_CALLBACK_DONE;
171}
172
173///////////////////////////////////////////////////////////////////////////
174
175void
176send_signal_icon_cache_update(Eina_Bool update)
177{
178 _broadcast(ipc, 2 /* icon cache update */, update, NULL, 0);
179}
180
181void
182send_signal_desktop_cache_update(Eina_Bool update)
183{
184 _broadcast(ipc, 3 /* desktop cache update */, update, NULL, 0);
185}
186
187Eina_Bool
188ipc_init(void)
189{
190 if (init > 0) return EINA_TRUE;
191 if (!ecore_ipc_init()) return EINA_FALSE;
192 ipc = ecore_ipc_server_add(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
193 if (!ipc)
194 {
195 ecore_ipc_shutdown();
196 return EINA_FALSE;
197 }
198 quit_timer = ecore_timer_add(10.0, _cb_quit_timer, NULL);
199 hnd_add = ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD,
200 _cb_client_add, NULL);
201 hnd_del = ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL,
202 _cb_client_del, NULL);
203 hnd_data = ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA,
204 _cb_client_data, NULL);
205 init++;
206 return EINA_TRUE;
207}
208
209Eina_Bool
210ipc_shutdown(void)
211{
212 if (init <= 0) return EINA_TRUE;
213 init--;
214 if (init > 0) return EINA_TRUE;
215 ecore_ipc_server_del(ipc);
216 ecore_event_handler_del(hnd_add);
217 ecore_event_handler_del(hnd_del);
218 ecore_event_handler_del(hnd_data);
219 ipc = NULL;
220 hnd_add = NULL;
221 hnd_del = NULL;
222 hnd_data = NULL;
223 ecore_ipc_shutdown();
224 return EINA_TRUE;
225}
226
diff --git a/src/bin/efreet/efreetd_dbus.h b/src/bin/efreet/efreetd_ipc.h
index 9e9fd70700..288f311add 100644
--- a/src/bin/efreet/efreetd_dbus.h
+++ b/src/bin/efreet/efreetd_ipc.h
@@ -1,10 +1,10 @@
1#ifndef __EFREETD_DBUS_H 1#ifndef __EFREETD_IPC_H
2#define __EFREETD_DBUS_H 2#define __EFREETD_IPC_H
3 3
4void send_signal_icon_cache_update(Eina_Bool update); 4void send_signal_icon_cache_update(Eina_Bool update);
5void send_signal_desktop_cache_update(Eina_Bool update); 5void send_signal_desktop_cache_update(Eina_Bool update);
6 6
7Eina_Bool dbus_init(void); 7Eina_Bool ipc_init(void);
8Eina_Bool dbus_shutdown(void); 8Eina_Bool ipc_shutdown(void);
9 9
10#endif 10#endif
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index 2200ee2a7c..6253954400 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -15,7 +15,7 @@
15#include <Eet.h> 15#include <Eet.h>
16#include <Ecore.h> 16#include <Ecore.h>
17#include <Ecore_File.h> 17#include <Ecore_File.h>
18#include <Eldbus.h> 18#include <Ecore_Ipc.h>
19 19
20/* define macros and variable for using the eina logging system */ 20/* define macros and variable for using the eina logging system */
21#define EFREET_MODULE_LOG_DOM _efreet_cache_log_dom 21#define EFREET_MODULE_LOG_DOM _efreet_cache_log_dom
@@ -35,13 +35,11 @@ struct _Efreet_Old_Cache
35 Eet_File *ef; 35 Eet_File *ef;
36}; 36};
37 37
38/* TODO: Common define location with daemon */ 38static Ecore_Ipc_Server *ipc = NULL;
39#define BUS "org.enlightenment.Efreet" 39static Eina_Prefix *pfx = NULL;
40#define PATH "/org/enlightenment/Efreet" 40static Ecore_Event_Handler *hnd_add = NULL;
41#define INTERFACE "org.enlightenment.Efreet" 41static Ecore_Event_Handler *hnd_del = NULL;
42 42static Ecore_Event_Handler *hnd_data = NULL;
43static Eldbus_Connection *conn = NULL;
44static Eldbus_Proxy *proxy = NULL;
45 43
46static Eina_Lock _lock; 44static Eina_Lock _lock;
47 45
@@ -97,10 +95,6 @@ static void efreet_cache_icon_theme_free(Efreet_Icon_Theme *theme);
97static Eina_Bool efreet_cache_check(Eet_File **ef, const char *path, int major); 95static Eina_Bool efreet_cache_check(Eet_File **ef, const char *path, int major);
98static void *efreet_cache_close(Eet_File *ef); 96static void *efreet_cache_close(Eet_File *ef);
99 97
100static void on_send_register(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending);
101static void desktop_cache_update(void *context, const Eldbus_Message *msg);
102static void icon_cache_update(void *context, const Eldbus_Message *msg);
103
104static void icon_cache_update_free(void *data, void *ev); 98static void icon_cache_update_free(void *data, void *ev);
105 99
106static void *hash_array_string_add(void *hash, const char *key, void *data); 100static void *hash_array_string_add(void *hash, const char *key, void *data);
@@ -109,6 +103,122 @@ EAPI int EFREET_EVENT_ICON_CACHE_UPDATE = 0;
109EAPI int EFREET_EVENT_DESKTOP_CACHE_UPDATE = 0; 103EAPI int EFREET_EVENT_DESKTOP_CACHE_UPDATE = 0;
110EAPI int EFREET_EVENT_DESKTOP_CACHE_BUILD = 0; 104EAPI int EFREET_EVENT_DESKTOP_CACHE_BUILD = 0;
111 105
106#define IPC_HEAD(_type) \
107 Ecore_Ipc_Event_Server_##_type *e = event; \
108 if (e->server != ipc) \
109 return ECORE_CALLBACK_PASS_ON
110
111static void
112_ipc_launch(void)
113{
114 char buf[PATH_MAX];
115 int num = 0;
116
117 if (!pfx) snprintf(buf, sizeof(buf), "efreetd");
118 else snprintf(buf, sizeof(buf), "%s/efreetd", eina_prefix_bin_get(pfx));
119 ecore_exe_run(buf, NULL);
120 while ((!ipc) && (num < 500))
121 {
122 num++;
123 usleep(1000);
124 ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
125 }
126}
127
128static Eina_Bool
129_cb_server_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
130{
131 IPC_HEAD(Add);
132 return ECORE_CALLBACK_DONE;
133}
134
135static Eina_Bool
136_cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
137{
138 IPC_HEAD(Del);
139 ipc = NULL;
140 _ipc_launch();
141 return ECORE_CALLBACK_DONE;
142}
143
144static Eina_Bool
145_cb_server_data(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
146{
147 IPC_HEAD(Data);
148 if (e->major == 1) // registration
149 {
150 if (e->minor == 1)
151 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, NULL, NULL, NULL);
152 }
153 else if (e->major == 2) // icon cache update
154 {
155 if (e->minor == 1)
156 {
157 Efreet_Event_Cache_Update *ev;
158
159 efreet_cache_desktop_close();
160
161 ev = NEW(Efreet_Event_Cache_Update, 1);
162 if (ev)
163 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, ev, NULL, NULL);
164 }
165 else
166 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, NULL, NULL, NULL);
167 }
168 else if (e->major == 3) // desktop cache update
169 {
170 Efreet_Event_Cache_Update *ev = NULL;
171 Efreet_Old_Cache *d = NULL;
172 Eina_List *l = NULL;
173
174 if (e->minor == 1)
175 {
176 ev = NEW(Efreet_Event_Cache_Update, 1);
177 if (!ev) goto error;
178
179 IF_RELEASE(theme_name);
180
181 // Save all old caches
182 d = NEW(Efreet_Old_Cache, 1);
183 if (!d) goto error;
184 d->hash = themes;
185 d->ef = icon_theme_cache;
186 l = eina_list_append(l, d);
187
188 d = NEW(Efreet_Old_Cache, 1);
189 if (!d) goto error;
190 d->hash = icons;
191 d->ef = icon_cache;
192 l = eina_list_append(l, d);
193
194 d = NEW(Efreet_Old_Cache, 1);
195 if (!d) goto error;
196 d->hash = fallbacks;
197 d->ef = fallback_cache;
198 l = eina_list_append(l, d);
199
200 // Create new empty caches
201 themes = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_theme_free));
202 icons = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_free));
203 fallbacks = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_fallback_free));
204
205 icon_theme_cache = NULL;
206 icon_cache = NULL;
207 fallback_cache = NULL;
208
209 // Send event
210 ecore_event_add(EFREET_EVENT_ICON_CACHE_UPDATE, ev, icon_cache_update_free, l);
211 goto done;
212 }
213error:
214 IF_FREE(ev);
215 EINA_LIST_FREE(l, d)
216 free(d);
217 }
218done:
219 return ECORE_CALLBACK_DONE;
220}
221
112int 222int
113efreet_cache_init(void) 223efreet_cache_init(void)
114{ 224{
@@ -139,31 +249,43 @@ efreet_cache_init(void)
139 fallbacks = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_fallback_free)); 249 fallbacks = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_fallback_free));
140 desktops = eina_hash_string_superfast_new(NULL); 250 desktops = eina_hash_string_superfast_new(NULL);
141 251
142 eldbus_init(); 252 ecore_ipc_init();
253 // XXX: connect to efreetd
254
143 if (efreet_cache_update) 255 if (efreet_cache_update)
144 { 256 {
145 conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION); 257 pfx = eina_prefix_new
146 if (conn) 258 (NULL, efreet_icon_cache_file, "EFREET", "efreet", "checkme",
147 { 259 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
148 Eldbus_Object *obj; 260 ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
149 261 if (!ipc) _ipc_launch();
150 obj = eldbus_object_get(conn, BUS, PATH); 262 if (ipc)
151 proxy = eldbus_proxy_get(obj, INTERFACE); 263 {
152 eldbus_proxy_signal_handler_add(proxy, "IconCacheUpdate", icon_cache_update, NULL); 264 const char *s;
153 eldbus_proxy_signal_handler_add(proxy, "DesktopCacheUpdate", desktop_cache_update, NULL); 265 int len = 0;
154 266
155 eldbus_proxy_call(proxy, "Register", on_send_register, NULL, -1, "s", efreet_language_get()); 267 hnd_add = ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
156 268 _cb_server_add, NULL);
157 /* 269 hnd_del = ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL,
158 * TODO: Needed? 270 _cb_server_del, NULL);
159 eldbus_name_owner_changed_callback_add(conn, BUS, on_name_owner_changed, 271 hnd_data = ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA,
160 conn, EINA_TRUE); 272 _cb_server_data, NULL);
161 */ 273 s = efreet_language_get();
162 } 274 if (s) len = strlen(s);
163 else 275 ecore_ipc_server_send(ipc, 1, 0, 0, 0, 0, s, len);
164 { 276 }
165 /* TODO: Run cache process directly */ 277 else
166 } 278 {
279 Efreet_Event_Cache_Update *ev;
280
281 WRN("Can't contact efreetd daemon for desktop/icon etc. changes");
282 ev = NEW(Efreet_Event_Cache_Update, 1);
283 if (ev)
284 {
285 ev->error = 1;
286 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, ev, NULL, NULL);
287 }
288 }
167 } 289 }
168 290
169 return 1; 291 return 1;
@@ -226,19 +348,16 @@ efreet_cache_shutdown(void)
226 util_cache = efreet_cache_close(util_cache); 348 util_cache = efreet_cache_close(util_cache);
227 IF_RELEASE(util_cache_file); 349 IF_RELEASE(util_cache_file);
228 350
229 /* 351 if (ipc) ecore_ipc_server_del(ipc);
230 * TODO: Needed?? 352 if (pfx) eina_prefix_free(pfx);
231 eldbus_name_owner_changed_callback_del(conn, BUS, on_name_owner_changed, conn); 353 if (hnd_add) ecore_event_handler_del(hnd_add);
232 */ 354 if (hnd_del) ecore_event_handler_del(hnd_del);
233 if (conn) 355 if (hnd_data) ecore_event_handler_del(hnd_data);
234 { 356 ipc = NULL;
235 Eldbus_Object *obj = eldbus_proxy_object_get(proxy); 357 pfx = NULL;
236 eldbus_proxy_unref(proxy); 358 hnd_add = NULL;
237 eldbus_object_unref(obj); 359 hnd_del = NULL;
238 eldbus_connection_unref(conn); 360 hnd_data = NULL;
239 }
240
241 eldbus_shutdown();
242 361
243 eina_lock_free(&_lock); 362 eina_lock_free(&_lock);
244 363
@@ -924,65 +1043,67 @@ efreet_cache_desktop_free(Efreet_Desktop *desktop)
924void 1043void
925efreet_cache_desktop_add(Efreet_Desktop *desktop) 1044efreet_cache_desktop_add(Efreet_Desktop *desktop)
926{ 1045{
927 Eldbus_Message *msg; 1046 char *path;
928 Eldbus_Message_Iter *iter, *array_of_string; 1047
929 char *path; 1048 if ((!efreet_cache_update) || (!ipc)) return;
930 1049 if (!eina_main_loop_is()) return;
931 if ((!efreet_cache_update) || (!proxy))
932 return;
933 /* TODO: Chunk updates */
934 if (!eina_main_loop_is()) return;
935 /* 1050 /*
936 * TODO: Call in thread with: 1051 * TODO: Call in thread with:
937 ecore_thread_main_loop_begin(); 1052 * ecore_thread_main_loop_begin();
938 ecore_thread_main_loop_end(); 1053 * ecore_thread_main_loop_end();
939 */ 1054 */
940 path = ecore_file_dir_get(desktop->orig_path); 1055 path = ecore_file_dir_get(desktop->orig_path);
941 msg = eldbus_proxy_method_call_new(proxy, "AddDesktopDirs"); 1056 if (!path) return;
942 iter = eldbus_message_iter_get(msg); 1057 ecore_ipc_server_send(ipc, 2, 0, 0, 0, 0, path, strlen(path));
943 array_of_string = eldbus_message_iter_container_new(iter, 'a',"s"); 1058 free(path);
944 eldbus_message_iter_basic_append(array_of_string, 's', path);
945 eldbus_message_iter_container_close(iter, array_of_string);
946 eldbus_proxy_send(proxy, msg, NULL, NULL, -1);
947 free(path);
948} 1059}
949 1060
950void 1061void
951efreet_cache_icon_exts_add(Eina_List *exts) 1062efreet_cache_icon_exts_add(Eina_List *exts)
952{ 1063{
953 Eldbus_Message *msg; 1064 Eina_List *l;
954 Eldbus_Message_Iter *iter, *array_of_string; 1065 const char *s;
955 Eina_List *l; 1066 Eina_Binbuf *buf;
956 const char *ext; 1067 int num = 0;
957 1068 unsigned char nil[1] = { 0 };
958 if ((!efreet_cache_update) || (!proxy)) 1069
959 return; 1070 if ((!efreet_cache_update) || (!ipc)) return;
960 msg = eldbus_proxy_method_call_new(proxy, "AddIconExts"); 1071 buf = eina_binbuf_new();
961 iter = eldbus_message_iter_get(msg); 1072 if (!buf) return;
962 array_of_string = eldbus_message_iter_container_new(iter, 'a',"s"); 1073 EINA_LIST_FOREACH(exts, l, s)
963 EINA_LIST_FOREACH(exts, l, ext) 1074 {
964 eldbus_message_iter_basic_append(array_of_string, 's', ext); 1075 if (num > 0) eina_binbuf_append_length(buf, nil, 1);
965 eldbus_message_iter_container_close(iter, array_of_string); 1076 eina_binbuf_append_length(buf, (unsigned char *)s, strlen(s));
966 eldbus_proxy_send(proxy, msg, NULL, NULL, -1); 1077 num++;
1078 }
1079 ecore_ipc_server_send(ipc, 5 /* add icon exts */, 0, 0, 0, 0,
1080 eina_binbuf_string_get(buf),
1081 eina_binbuf_length_get(buf));
1082 eina_binbuf_free(buf);
967} 1083}
968 1084
969void 1085void
970efreet_cache_icon_dirs_add(Eina_List *dirs) 1086efreet_cache_icon_dirs_add(Eina_List *dirs)
971{ 1087{
972 Eldbus_Message *msg; 1088 Eina_List *l;
973 Eldbus_Message_Iter *iter, *array_of_string; 1089 const char *s;
974 Eina_List *l; 1090 Eina_Binbuf *buf;
975 const char *dir; 1091 int num = 0;
976 1092 unsigned char nil[1] = { 0 };
977 if ((!efreet_cache_update) || (!proxy)) 1093
978 return; 1094 if ((!efreet_cache_update) || (!ipc)) return;
979 msg = eldbus_proxy_method_call_new(proxy, "AddIconDirs"); 1095 buf = eina_binbuf_new();
980 iter = eldbus_message_iter_get(msg); 1096 if (!buf) return;
981 array_of_string = eldbus_message_iter_container_new(iter, 'a',"s"); 1097 EINA_LIST_FOREACH(dirs, l, s)
982 EINA_LIST_FOREACH(dirs, l, dir) 1098 {
983 eldbus_message_iter_basic_append(array_of_string, 's', dir); 1099 if (num > 0) eina_binbuf_append_length(buf, nil, 1);
984 eldbus_message_iter_container_close(iter, array_of_string); 1100 eina_binbuf_append_length(buf, (unsigned char *)s, strlen(s));
985 eldbus_proxy_send(proxy, msg, NULL, NULL, -1); 1101 num++;
1102 }
1103 ecore_ipc_server_send(ipc, 4 /* add icon dirs */, 0, 0, 0, 0,
1104 eina_binbuf_string_get(buf),
1105 eina_binbuf_length_get(buf));
1106 eina_binbuf_free(buf);
986} 1107}
987 1108
988void 1109void
@@ -1025,9 +1146,12 @@ efreet_cache_desktop_close(void)
1025void 1146void
1026efreet_cache_desktop_build(void) 1147efreet_cache_desktop_build(void)
1027{ 1148{
1028 if ((!efreet_cache_update) || (!proxy)) 1149 const char *s;
1029 return; 1150 int len = 0;
1030 eldbus_proxy_call(proxy, "BuildDesktopCache", NULL, NULL, -1, "s", efreet_language_get()); 1151 if ((!efreet_cache_update) || (!ipc)) return;
1152 s = efreet_language_get();
1153 if (s) len = strlen(s);
1154 ecore_ipc_server_send(ipc, 3 /* build desktop cache */, 0, 0, 0, 0, s, len);
1031} 1155}
1032 1156
1033static Eina_Bool 1157static Eina_Bool
@@ -1122,103 +1246,6 @@ efreet_cache_util_names(const char *key)
1122} 1246}
1123 1247
1124static void 1248static void
1125on_send_register(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
1126{
1127 const char *errname, *errmsg;
1128 Eina_Bool exists;
1129
1130 if (eldbus_message_error_get(msg, &errname, &errmsg))
1131 {
1132 Efreet_Event_Cache_Update *ev = NULL;
1133
1134 WRN("%s %s", errname, errmsg);
1135
1136 ev = NEW(Efreet_Event_Cache_Update, 1);
1137 if (ev)
1138 {
1139 ev->error = 1;
1140 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, ev, NULL, NULL);
1141 }
1142 }
1143 else if (eldbus_message_arguments_get(msg, "b", &exists) && exists)
1144 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, NULL, NULL, NULL);
1145}
1146
1147static void
1148desktop_cache_update(void *context EINA_UNUSED, const Eldbus_Message *msg)
1149{
1150 Eina_Bool update;
1151
1152 if (eldbus_message_arguments_get(msg, "b", &update))
1153 {
1154 if (update)
1155 {
1156 Efreet_Event_Cache_Update *ev = NULL;
1157
1158 efreet_cache_desktop_close();
1159
1160 ev = NEW(Efreet_Event_Cache_Update, 1);
1161 if (ev)
1162 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, ev, NULL, NULL);
1163 }
1164 ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, NULL, NULL, NULL);
1165 }
1166}
1167
1168static void
1169icon_cache_update(void *context EINA_UNUSED, const Eldbus_Message *msg)
1170{
1171 Efreet_Event_Cache_Update *ev = NULL;
1172 Efreet_Old_Cache *d = NULL;
1173 Eina_List *l = NULL;
1174 Eina_Bool update;
1175
1176 if (eldbus_message_arguments_get(msg, "b", &update) && update)
1177 {
1178 ev = NEW(Efreet_Event_Cache_Update, 1);
1179 if (!ev) goto error;
1180
1181 IF_RELEASE(theme_name);
1182
1183 /* Save all old caches */
1184 d = NEW(Efreet_Old_Cache, 1);
1185 if (!d) goto error;
1186 d->hash = themes;
1187 d->ef = icon_theme_cache;
1188 l = eina_list_append(l, d);
1189
1190 d = NEW(Efreet_Old_Cache, 1);
1191 if (!d) goto error;
1192 d->hash = icons;
1193 d->ef = icon_cache;
1194 l = eina_list_append(l, d);
1195
1196 d = NEW(Efreet_Old_Cache, 1);
1197 if (!d) goto error;
1198 d->hash = fallbacks;
1199 d->ef = fallback_cache;
1200 l = eina_list_append(l, d);
1201
1202 /* Create new empty caches */
1203 themes = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_theme_free));
1204 icons = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_free));
1205 fallbacks = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_fallback_free));
1206
1207 icon_theme_cache = NULL;
1208 icon_cache = NULL;
1209 fallback_cache = NULL;
1210
1211 /* Send event */
1212 ecore_event_add(EFREET_EVENT_ICON_CACHE_UPDATE, ev, icon_cache_update_free, l);
1213 }
1214 return;
1215error:
1216 IF_FREE(ev);
1217 EINA_LIST_FREE(l, d)
1218 free(d);
1219}
1220
1221static void
1222icon_cache_update_free(void *data, void *ev) 1249icon_cache_update_free(void *data, void *ev)
1223{ 1250{
1224 Efreet_Old_Cache *d; 1251 Efreet_Old_Cache *d;
diff --git a/systemd-services/efreet.service.in b/systemd-services/efreet.service.in
deleted file mode 100644
index ee1becbfde..0000000000
--- a/systemd-services/efreet.service.in
+++ /dev/null
@@ -1,7 +0,0 @@
1[Unit]
2Description=Efreet Enlightenment FreeDesktop.Org Daemon
3
4[Service]
5Type=dbus
6BusName=org.enlightenment.Efreet
7ExecStart=@prefix@/bin/efreetd