add efm op to notify of device backend changes

This commit is contained in:
Mike Blumenkrantz 2014-05-07 16:46:56 -04:00
parent 157702c6d1
commit 0202c19d49
5 changed files with 22 additions and 1 deletions

View File

@ -2959,6 +2959,9 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
}
switch (e->minor)
{
case E_FM_OP_INIT:
e_config->device_detect_mode = strtoul((char*)e->data, NULL, 10);
break;
case E_FM_OP_MONITOR_SYNC: /*mon list sync*/
ecore_ipc_client_send(cl->cl, E_IPC_DOMAIN_FM, E_FM_OP_MONITOR_SYNC,
0, 0, e->response,

View File

@ -161,6 +161,18 @@ main(int argc, char **argv)
return 0;
}
void
_e_fm_main_catch(unsigned int val)
{
char buf[64];
snprintf(buf, sizeof(buf), "%u", val);
ecore_ipc_server_send(_e_fm_ipc_server,
6 /*E_IPC_DOMAIN_FM*/,
E_FM_OP_INIT,
0, 0, 0, buf, strlen(buf) + 1);
}
#ifdef HAVE_UDISKS_MOUNT
void
_e_fm_main_udisks_catch(Eina_Bool usable)
@ -168,6 +180,7 @@ _e_fm_main_udisks_catch(Eina_Bool usable)
if (usable)
{
mode = EFM_MODE_USING_UDISKS_MOUNT;
_e_fm_main_catch(mode);
return;
}
# ifdef HAVE_EEZE_MOUNT
@ -182,6 +195,7 @@ _e_fm_main_udisks2_catch(Eina_Bool usable)
if (usable)
{
mode = EFM_MODE_USING_UDISKS2_MOUNT;
_e_fm_main_catch(mode);
return;
}
_e_fm_main_udisks_init();

View File

@ -16,6 +16,8 @@
extern Ecore_Ipc_Server *_e_fm_ipc_server;
extern int efm_log_dom;
void _e_fm_main_catch(unsigned int val);
#define E_FM_MOUNT_TIMEOUT 30.0
#define E_FM_UNMOUNT_TIMEOUT 60.0
#define E_FM_EJECT_TIMEOUT 15.0

View File

@ -668,6 +668,7 @@ _scanner_run(void)
static Eina_Bool
_scanner_con(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Server_Del *ev __UNUSED__)
{
_e_fm_main_catch(EFM_MODE_USING_EEZE_MOUNT);
INF("Scanner connected");
es_con = eet_connection_new(_scanner_read, _scanner_write, NULL);
return ECORE_CALLBACK_RENEW;

View File

@ -53,7 +53,8 @@ typedef enum _E_Fm_Op_Type
E_FM_OP_EJECT_ERROR,
E_FM_OP_SECURE_REMOVE,
E_FM_OP_DESTROY,
E_FM_OP_VOLUME_LIST_DONE
E_FM_OP_VOLUME_LIST_DONE,
E_FM_OP_INIT
} E_Fm_Op_Type;
#else