Enlightenment CVS committal
Author : devilhorns
Project : e_modules
Module : mbar
Dir : e_modules/mbar
Modified Files:
e_mod_main.c TODO
Log Message:
Support Monitoring /etc/mtab for mount changes, requested by boneyfrog
--TODO
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/mbar/e_mod_main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_mod_main.c 18 Mar 2006 23:17:23 -0000 1.2
+++ e_mod_main.c 20 Mar 2006 21:08:48 -0000 1.3
@@ -108,6 +108,7 @@
static int _mbar_parse_file(char *file, const char *mntpath);
static void _mbar_parse_fstab(MBar *mb);
static void _mbar_add_order(const char *dir, const char *name);
+static void _mbar_mtab_update(void *data, Ecore_File_Monitor *monitor,
Ecore_File_Event event, const char *path);
/* Config Updated Function Protos */
static void _mbar_bar_cb_width_auto(void *data);
@@ -325,6 +326,9 @@
}
}
}
+
+ /* Add File Monitor for /etc/mtab */
+ mb->mon = ecore_file_monitor_add("/etc/mtab", _mbar_mtab_update, mb);
return mb;
}
@@ -342,6 +346,10 @@
if (mb->conf->appdir) evas_stringshare_del(mb->conf->appdir);
e_app_change_callback_del(_mbar_app_change, mb);
e_object_del(E_OBJECT(mb->config_menu));
+
+ if (mb->mon)
+ ecore_file_monitor_del(mb->mon);
+
evas_list_free(mb->conf->bars);
free(mb->conf);
free(mb);
@@ -2154,3 +2162,39 @@
fwrite(name, sizeof(char), strlen(name), f);
fclose(f);
}
+
+static void
+_mbar_mtab_update(void *data, Ecore_File_Monitor *monitor, Ecore_File_Event
event, const char *path)
+{
+ MBar *mb;
+ Evas_List *l, *il;
+ const char *file;
+
+ mb = data;
+ if (!mb)
+ return;
+
+ file = ecore_file_get_file((char *)path);
+ if (!strcmp(file, "mtab"))
+ {
+ if (event == ECORE_FILE_EVENT_MODIFIED)
+ {
+ for (l = mb->bars; l; l = l->next)
+ {
+ MBar_Bar *mbb;
+ mbb = l->data;
+ if (!mbb)
+ continue;
+ for (il = mbb->icons; il; il = il->next)
+ {
+ MBar_Icon *ic;
+ int mounted;
+
+ ic = il->data;
+ mounted = _mbar_is_mounted(ic->app->generic);
+ _mbar_set_state(ic, mounted);
+ }
+ }
+ }
+ }
+}
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/mbar/TODO,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- TODO 20 Mar 2006 16:58:39 -0000 1.2
+++ TODO 20 Mar 2006 21:08:49 -0000 1.3
@@ -8,4 +8,3 @@
Support automount
Support labels for devices.
Support turning off eject for a device.
-Support Polling mtab to keep track of what is mounted/unmounted.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs