Efsd updates. Now I remember what I forgot in the efsd commit comment --

I changed the name of some of the convenience calls from efsd_reply_...
to efsd_event_... because they're no longer applicable to reply events
only.

I've also hooked in a cleanup function for Efsd when E exits, and
duplicated memory when accessing a returned metadata string.


SVN revision: 5736
This commit is contained in:
cpk 2001-11-26 01:10:48 +00:00 committed by cpk
parent 0ce64e39cf
commit 630bf3c408
6 changed files with 45 additions and 13 deletions

View File

@ -1555,7 +1555,7 @@ e_act_exit_start (E_Object *object, E_Action *a, void *data, int x, int y, int r
ecore_sync(); ecore_sync();
e_db_flush(); e_db_flush();
exit(0); exit(0);
D_RETURN; D_RETURN;

View File

@ -220,6 +220,18 @@ e_fs_init(void)
D_RETURN; D_RETURN;
} }
void
e_fs_cleanup(void)
{
D_ENTER;
efsd_close(ec);
D("Connection to Efsd closed.\n");
D_RETURN;
}
EfsdConnection * EfsdConnection *
e_fs_get_connection(void) e_fs_get_connection(void)
{ {

View File

@ -20,6 +20,14 @@ struct _E_FS_Restarter
*/ */
void e_fs_init(void); void e_fs_init(void);
/**
* e_fs_cleanup - Filesystem code cleanup routine.
*
* This function takes care of properly saying
* good bye to Efsd.
*/
void e_fs_cleanup(void);
E_FS_Restarter *e_fs_add_restart_handler(void (*func) (void *data), void *data); E_FS_Restarter *e_fs_add_restart_handler(void (*func) (void *data), void *data);
void e_fs_del_restart_handler(E_FS_Restarter *rs); void e_fs_del_restart_handler(E_FS_Restarter *rs);
void e_fs_add_event_handler(void (*func) (EfsdEvent *ev)); void e_fs_add_event_handler(void (*func) (EfsdEvent *ev));

View File

@ -35,6 +35,7 @@ static void cb_exit(void)
{ {
D_ENTER; D_ENTER;
e_fs_cleanup();
E_PROF_DUMP; E_PROF_DUMP;
D_RETURN; D_RETURN;

View File

@ -2006,7 +2006,7 @@ e_view_handle_fs(EfsdEvent *ev)
{ {
E_View *v; E_View *v;
v = e_view_find_by_monitor_id(efsd_reply_id(ev)); v = e_view_find_by_monitor_id(efsd_event_id(ev));
if (v) v->is_listing = 0; if (v) v->is_listing = 0;
/* D("EFSD_CHANGE_END_EXISTS: %i %s\n", /* D("EFSD_CHANGE_END_EXISTS: %i %s\n",
ev->efsd_filechange_event.id, ev->efsd_filechange_event.id,
@ -2042,11 +2042,11 @@ e_view_handle_fs(EfsdEvent *ev)
char *file; char *file;
file = NULL; file = NULL;
if ( (file = efsd_reply_filename(ev)) ) if ( (file = efsd_event_filename(ev)) )
{ {
file = e_file_get_file(file); file = e_file_get_file(file);
} }
v = e_view_find_by_monitor_id(efsd_reply_id(ev)); v = e_view_find_by_monitor_id(efsd_event_id(ev));
if ((v) && (file)) if ((v) && (file))
{ {
@ -2098,15 +2098,15 @@ e_view_handle_fs(EfsdEvent *ev)
E_Icon *ic; E_Icon *ic;
E_View *v; E_View *v;
v = e_view_find_by_monitor_id(efsd_reply_id(ev)); v = e_view_find_by_monitor_id(efsd_event_id(ev));
if (v) if (v)
{ {
ic = e_icon_find_by_file(v, e_file_get_file(efsd_reply_filename(ev))); ic = e_icon_find_by_file(v, e_file_get_file(efsd_event_filename(ev)));
if (ic) if (ic)
{ {
ic->stat = *((struct stat*)efsd_reply_data(ev)); ic->stat = *((struct stat*)efsd_event_data(ev));
e_icon_check_permissions(ic); e_icon_check_permissions(ic);
} }
} }
@ -2121,17 +2121,17 @@ e_view_handle_fs(EfsdEvent *ev)
char *file; char *file;
file = NULL; file = NULL;
if ( (file = efsd_reply_filename(ev)) ) if ( (file = efsd_event_filename(ev)) )
{ {
file = e_file_get_file(file); file = e_file_get_file(file);
} }
v = e_view_find_by_monitor_id(efsd_reply_id(ev)); v = e_view_find_by_monitor_id(efsd_event_id(ev));
if ((v) && (file)) if ((v) && (file))
{ {
ic = e_icon_find_by_file(v, file); ic = e_icon_find_by_file(v, file);
if ((ic) && if ((ic) &&
(ev->efsd_reply_event.data)) (ev->efsd_reply_event.data))
e_icon_set_link(ic, (char*)efsd_reply_data(ev)); e_icon_set_link(ic, (char*)efsd_event_data(ev));
e_icon_initial_show(ic); e_icon_initial_show(ic);
} }
} }
@ -2147,7 +2147,7 @@ e_view_handle_fs(EfsdEvent *ev)
Evas_List l; Evas_List l;
EfsdCmdId cmd; EfsdCmdId cmd;
cmd = efsd_reply_id(ev); cmd = efsd_event_id(ev);
for (l = views; l; l = l->next) for (l = views; l; l = l->next)
{ {
E_View *v; E_View *v;
@ -2246,7 +2246,7 @@ e_view_handle_fs(EfsdEvent *ev)
char buf[PATH_MAX]; char buf[PATH_MAX];
IF_FREE(v->bg_file); IF_FREE(v->bg_file);
v->bg_file = efsd_metadata_get_str(ev); e_strdup(v->bg_file, efsd_metadata_get_str(ev));
sprintf(buf, "background_reload:%s", v->dir); sprintf(buf, "background_reload:%s", v->dir);
ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v); ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v);
} }
@ -2397,6 +2397,7 @@ e_view_bg_reload_timeout(int val, void *data)
e_view_bg_load(v); e_view_bg_load(v);
D_RETURN; D_RETURN;
UN(val);
} }
void void

View File

@ -52,6 +52,16 @@ struct _E_View
struct { struct {
int x, y; int x, y;
} location; } location;
/* This part stores the Efsd command
IDs for requested metadata. */
struct {
struct {
EfsdCmdId x, y, w, h, bg;
} id;
int busy;
} metadata;
struct { struct {
/* +-----------------+ /* +-----------------+
* | Wt | * | Wt |
@ -136,7 +146,7 @@ struct _E_View
E_Background *bg; E_Background *bg;
struct { struct {
E_Scrollbar *h, *v; E_Scrollbar *h, *v;
} scrollbar; } scrollbar;
int is_listing; int is_listing;