Index: guitools.c =================================================================== RCS file: /cvs/gpe/base/gpe-filemanager/guitools.c,v retrieving revision 1.4 diff -u -r1.4 guitools.c --- guitools.c 19 Sep 2004 23:54:26 -0000 1.4 +++ guitools.c 13 Oct 2004 22:17:25 -0000 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -38,7 +39,7 @@ static t_storage *storages = NULL; static int num_storage = 0; - +static time_t mtab_time = 0; /* checks if a tree is mounted */ static gboolean @@ -189,6 +190,23 @@ } +gboolean +check_mount(void) +{ + struct stat sdat; + + if (!stat(FILE_MTAB, &sdat)) + { + if (mtab_time != sdat.st_ctime) + { + do_scheduled_update(); + mtab_time = sdat.st_ctime; + } + } + return TRUE; +} + + GtkWidget * build_storage_menu(gboolean wide) { @@ -250,8 +268,11 @@ GNOME_VFS_MONITOR_FILE, (GnomeVFSMonitorCallback)mountpoint_changed, NULL)) != GNOME_VFS_OK) - fprintf(stderr, "Installing monitor failed: %s\n", + { + fprintf(stderr, "Installing monitor failed: %s\n", gnome_vfs_result_to_string(ret)); - + fprintf(stderr, "Polling...\n"); + g_timeout_add(1000, (GSourceFunc)check_mount, NULL); + } return vmenu; }