Index: src/fusa-manager.c
===================================================================
--- src/fusa-manager.c	(revisione 494)
+++ src/fusa-manager.c	(copia locale)
@@ -40,7 +40,7 @@
 #include <gtk/gtkmain.h>
 #include <gtk/gtkstock.h>
 
-#include <libgnomevfs/gnome-vfs-ops.h>
+#include <gio/gio.h>
 
 #include "gdm-queue.h"
 #include "fusa-utils.h"
@@ -121,9 +121,9 @@ struct _FusaManager
   GHashTable *users_by_uid;
 
   /* Updaters */
-  GnomeVFSMonitorHandle *gdmconfig_monitor;
-  GnomeVFSMonitorHandle *passwd_monitor;
-  GnomeVFSMonitorHandle *shells_monitor;
+  GFileMonitor *gdmconfig_monitor;
+  GFileMonitor *passwd_monitor;
+  GFileMonitor *shells_monitor;
   guint results_pull_id;
   guint update_displays_id;
 
@@ -193,22 +193,25 @@ FusaManagerWithCallback;
 /* GObject Functions */
 static void fusa_manager_finalize (GObject *object);
 
-/* GnomeVFSMonitor Callbacks */
-static void gdmconfig_monitor_cb (GnomeVFSMonitorHandle    *handle,
-				  const gchar              *text_uri,
-				  const gchar              *info_uri,
-				  GnomeVFSMonitorEventType  event_type,
-				  gpointer                  user_data);
-static void shells_monitor_cb    (GnomeVFSMonitorHandle    *handle,
-				  const gchar              *text_uri,
-				  const gchar              *info_uri,
-				  GnomeVFSMonitorEventType  event_type,
-				  gpointer                  user_data);
-static void passwd_monitor_cb    (GnomeVFSMonitorHandle    *handle,
-				  const gchar              *text_uri,
-				  const gchar              *info_uri,
-				  GnomeVFSMonitorEventType  event_type,
-				  gpointer                  user_data);
+/* GFileMonitor Callbacks */
+static void
+gdmconfig_monitor_changed_cb (GFileMonitor      *monitor,
+			      GFile             *file,
+			      GFile             *other_file,
+			      GFileMonitorEvent  event,
+			      gpointer           data);
+static void
+shells_monitor_changed_cb (GFileMonitor      *monitor,
+			   GFile             *file,
+			   GFile             *other_file,
+			   GFileMonitorEvent  event,
+			   gpointer           data);
+static void
+passwd_monitor_changed_cb (GFileMonitor      *monitor,
+			   GFile             *file,
+			   GFile             *other_file,
+			   GFileMonitorEvent  event,
+			   gpointer           data);
 
 /* User Functions */
 static gboolean        check_user_file                (const gchar  *filename,
@@ -334,83 +337,66 @@ fusa_manager_class_init (FusaManagerClas
 static void
 fusa_manager_init (FusaManager *manager)
 {
-  GError *error;
-  gchar *uri;
-  GnomeVFSResult result;
-
+  GFile *file = NULL;
+  GError *error = NULL;
   /* GDM config file */
   manager->exclusions = g_hash_table_new_full (g_str_hash, g_str_equal,
 					       g_free, NULL);
   reload_gdm_config (manager, FALSE);
-  error = NULL;
-  uri = g_filename_to_uri (GDMCONFIGFILE, NULL, &error);
-  if (!uri)
-    {
-      g_critical ("Could not create URI for GDM configuration file `%s': %s",
-		  GDMCONFIGFILE, error->message);
-      g_error_free (error);
-    }
-  else
-    {
-      result = gnome_vfs_monitor_add (&(manager->gdmconfig_monitor), uri,
-				      GNOME_VFS_MONITOR_FILE,
-				      gdmconfig_monitor_cb, manager);
-      g_free (uri);
 
-      if (result != GNOME_VFS_OK)
+  file = g_file_new_for_path (GDMCONFIGFILE);
+  manager->gdmconfig_monitor = g_file_monitor_file (file,
+  						    0, NULL, &error);
+  if (manager->gdmconfig_monitor == NULL) {
 	g_critical ("Could not install monitor for GDM configuration file `%s': %s",
-		    GDMCONFIGFILE, gnome_vfs_result_to_string (result));
-    }
+		    GDMCONFIGFILE, error->message);
+	g_error_free (error);
+	error = NULL;
+  } else {
+  	g_signal_connect (manager->gdmconfig_monitor, "changed",
+			  G_CALLBACK (gdmconfig_monitor_changed_cb), manager);
+	g_object_unref (file);
+	file = NULL;
+  }
 
   /* /etc/shells */
   manager->shells = g_hash_table_new_full (g_str_hash, g_str_equal,
 					   g_free, NULL);
   reload_shells (manager);
-  error = NULL;
-  uri = g_filename_to_uri ("/etc/shells", NULL, &error);
-  if (!uri)
-    {
-      g_critical ("Could not create URI for shells file `/etc/shells': %s",
-		  error->message);
-      g_error_free (error);
-    }
-  else
-    {
-      result = gnome_vfs_monitor_add (&(manager->shells_monitor), uri,
-				      GNOME_VFS_MONITOR_FILE,
-				      shells_monitor_cb, manager);
-      g_free (uri);
 
-      if (result != GNOME_VFS_OK)
+  file = g_file_new_for_path ("/etc/shells");
+  manager->shells_monitor = g_file_monitor_file (file,
+  						 0, NULL, &error);
+  if (manager->shells_monitor == NULL) {
 	g_critical ("Could not install monitor for shells file `/etc/shells': %s",
-		    gnome_vfs_result_to_string (result));
-    }
+		    error->message);
+	g_error_free (error);
+	error = NULL;
+  } else {
+  	g_signal_connect (manager->shells_monitor, "changed",
+			  G_CALLBACK (shells_monitor_changed_cb), manager);
+	g_object_unref (file);
+	file = NULL;
+  }
 
   /* /etc/passwd */
   manager->users =
     g_hash_table_new_full (g_str_hash, g_str_equal,
 			   g_free, (GDestroyNotify) g_object_run_dispose);
   manager->users_by_uid = g_hash_table_new (NULL, NULL);
-  error = NULL;
-  uri = g_filename_to_uri ("/etc/passwd", NULL, &error);
-  if (!uri)
-    {
-      g_critical ("Could not create URI for password file `/etc/passwd': %s",
-		  error->message);
-      g_error_free (error);
-    }
-  else
-    {
-      result = gnome_vfs_monitor_add (&(manager->passwd_monitor), uri,
-				      GNOME_VFS_MONITOR_FILE,
-				      passwd_monitor_cb, manager);
-      g_free (uri);
 
-      if (result != GNOME_VFS_OK)
+  file = g_file_new_for_path ("/etc/passwd");
+  manager->passwd_monitor = g_file_monitor_file (file,
+  					         0, NULL, &error);
+  if (manager->passwd_monitor == NULL) {
 	g_critical ("Could not install monitor for password file `/etc/passwd: %s",
-		    gnome_vfs_result_to_string (result));
-    }
-
+		    error->message);
+  } else {
+  	g_signal_connect (manager->passwd_monitor, "changed",
+			  G_CALLBACK (passwd_monitor_changed_cb), manager);
+	g_object_unref (file);
+	file = NULL;
+  }
 
   /* Displays */
   manager->displays =
@@ -452,14 +438,14 @@ fusa_manager_finalize (GObject *object)
   g_hash_table_destroy (manager->displays);
   g_hash_table_destroy (manager->displays_by_console);
 
-  gnome_vfs_monitor_cancel (manager->shells_monitor);
+  g_file_monitor_cancel (manager->shells_monitor);
   g_hash_table_destroy (manager->shells);
 
-  gnome_vfs_monitor_cancel (manager->gdmconfig_monitor);
+  g_file_monitor_cancel (manager->gdmconfig_monitor);
   g_hash_table_destroy (manager->exclusions);
   g_free (manager->global_face_dir);
 
-  gnome_vfs_monitor_cancel (manager->passwd_monitor);
+  g_file_monitor_cancel (manager->passwd_monitor);
   g_hash_table_destroy (manager->users);
   g_hash_table_destroy (manager->users_by_uid);
 
@@ -468,21 +454,21 @@ fusa_manager_finalize (GObject *object)
 }
 
 
-/* *************************** *
- *  GnomeVFSMonitor Callbacks  *
- * *************************** */
+/* ************************ *
+ *  GFileMonitor Callbacks  *
+ * ************************ */
 
 static void
-gdmconfig_monitor_cb (GnomeVFSMonitorHandle    *handle,
-		      const gchar              *text_uri,
-		      const gchar              *info_uri,
-		      GnomeVFSMonitorEventType  event_type,
-		      gpointer                  data)
+gdmconfig_monitor_changed_cb (GFileMonitor      *monitor,
+			      GFile             *file,
+			      GFile             *other_file,
+			      GFileMonitorEvent  event,
+			      gpointer           data)
 {
   FusaManager *manager = data;
 
-  if (event_type != GNOME_VFS_MONITOR_EVENT_CHANGED &&
-      event_type != GNOME_VFS_MONITOR_EVENT_CREATED)
+  if (event != G_FILE_MONITOR_EVENT_CHANGED &&
+      event != G_FILE_MONITOR_EVENT_CREATED)
     return;
   
   manager->users_dirty = FALSE;
@@ -492,14 +478,14 @@ gdmconfig_monitor_cb (GnomeVFSMonitorHan
 }
 
 static void
-shells_monitor_cb (GnomeVFSMonitorHandle    *handle,
-		   const gchar              *text_uri,
-		   const gchar              *info_uri,
-		   GnomeVFSMonitorEventType  event_type,
-		   gpointer                  data)
+shells_monitor_changed_cb (GFileMonitor      *monitor,
+			   GFile             *file,
+			   GFile             *other_file,
+			   GFileMonitorEvent  event,
+			   gpointer           data)
 {
-  if (event_type != GNOME_VFS_MONITOR_EVENT_CHANGED &&
-      event_type != GNOME_VFS_MONITOR_EVENT_CREATED)
+  if (event != G_FILE_MONITOR_EVENT_CHANGED &&
+      event != G_FILE_MONITOR_EVENT_CREATED)
     return;
 
   reload_shells (data);
@@ -507,17 +493,17 @@ shells_monitor_cb (GnomeVFSMonitorHandle
 }
 
 static void
-passwd_monitor_cb (GnomeVFSMonitorHandle    *handle,
-		   const gchar              *text_uri,
-		   const gchar              *info_uri,
-		   GnomeVFSMonitorEventType  event_type,
-		   gpointer                  user_data)
+passwd_monitor_changed_cb (GFileMonitor      *monitor,
+			   GFile             *file,
+			   GFile             *other_file,
+			   GFileMonitorEvent  event,
+			   gpointer           data)
 {
-  if (event_type != GNOME_VFS_MONITOR_EVENT_CHANGED &&
-      event_type != GNOME_VFS_MONITOR_EVENT_CREATED)
+  if (event != G_FILE_MONITOR_EVENT_CHANGED &&
+      event != G_FILE_MONITOR_EVENT_CREATED)
     return;
 
-  reload_passwd (user_data);
+  reload_passwd (data);
 }
 
 static FusaManagerWithCallback*
@@ -764,7 +750,7 @@ reload_gdm_config (FusaManager *manager,
   for (handler=settings_handlers; handler->key != NULL; handler++) {
 
     /* If we're here because the file has been updated, then *we* know the
-     * value might have changed (because gnome-vfs told us), but gdm is most
+     * value might have changed (because GFileMonitor told us), but gdm is most
      * probably still unaware. Therefore, we must tell it to go and look.
      * Unfortunately, there's no way of telling gdm over the socket to go
      * and reload the file in toto, but we can tell it to reload those
@@ -1278,8 +1264,10 @@ render_icon_from_home (FusaManager  *man
   const gchar *homedir, *username;
   uid_t uid;
   gchar *path;
-  GnomeVFSURI *uri;
-  gboolean is_local;
+  GFile *file;
+  GFileInfo *file_info;
+  const char *filesystem_type;
+  gboolean is_autofs, is_local = FALSE;
 
   homedir = fusa_user_get_home_directory (user);
   uid = fusa_user_get_uid (user);
@@ -1288,17 +1276,44 @@ render_icon_from_home (FusaManager  *man
   /* special case: look at parent of home to detect autofs
      this is so we don't try to trigger an automount */
   path = g_path_get_dirname (homedir);
-  uri = gnome_vfs_uri_new (path);
-  is_local = gnome_vfs_uri_is_local (uri);
-  gnome_vfs_uri_unref (uri);
+  file = g_file_new_for_path (path);
+  file_info = g_file_query_filesystem_info (file,
+					    G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
+					    NULL, NULL);
+  if (file_info == NULL)
+    {
+      g_free (path);
+      g_object_unref (file);
+      return NULL;
+    }
+  filesystem_type = g_file_info_get_attribute_string (file_info,
+  						      G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
+  is_autofs = (strcmp (filesystem_type, "autofs") == 0);
+  g_object_unref (file);
+  g_object_unref (file_info);
   g_free (path);
 
   /* now check that home dir itself is local */
-  if (is_local)
+  if (!is_autofs)
     {
-      uri = gnome_vfs_uri_new (homedir);
-      is_local = gnome_vfs_uri_is_local (uri);
-      gnome_vfs_uri_unref (uri);
+      file = g_file_new_for_path (homedir);
+      file_info = g_file_query_filesystem_info (file,
+      						G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
+						NULL, NULL);
+      if (file_info == NULL)
+        {
+	  g_object_unref (file);
+	  return NULL;
+	}
+      filesystem_type = g_file_info_get_attribute_string (file_info,
+      							  G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
+      is_local = ((strcmp (filesystem_type, "nfs") != 0) && 
+		  (strcmp (filesystem_type, "afs") != 0) &&
+		  (strcmp (filesystem_type, "autofs") != 0) &&
+		  (strcmp (filesystem_type, "unknown") != 0) &&
+		  (strcmp (filesystem_type, "ncpfs") != 0));
+      g_object_unref (file_info);
+      g_object_unref (file);
     }
 
   /* only look at local home directories so we don't try to
Index: src/testapp.c
===================================================================
--- src/testapp.c	(revisione 494)
+++ src/testapp.c	(copia locale)
@@ -28,7 +28,6 @@
 #include <string.h>
 
 #include <gtk/gtk.h>
-#include <libgnomevfs/gnome-vfs-init.h>
 
 #include "fusa-utils.h"
 #include "fusa-manager.h"
@@ -557,7 +556,6 @@ main (int   argc,
   GSList *list;
 
   gtk_init (&argc, &argv);
-  gnome_vfs_init ();
 
   gtk_rc_parse_string ("style \"fast-user-switch-menubar-style\"\n"
 		       "{\n"
@@ -801,7 +799,6 @@ main (int   argc,
   g_object_unref (app->manager);
   gtk_widget_destroy (app->app);
   g_free (app);
-  gnome_vfs_shutdown ();
 
   return 0;
 }
Index: configure.ac
===================================================================
--- configure.ac	(revisione 494)
+++ configure.ac	(copia locale)
@@ -46,10 +46,12 @@ AC_DEFUN([AC_DEFINE_PATH], [
 GTK_REQUIRED_VERSION=2.8.0
 PANEL_REQUIRED_VERSION=2.0.0
 GLADE_REQUIRED_VERSION=2.0.0
+GLIB_REQUIRED_VERSION=2.15.3
 
 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
 	     libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION
-	     libglade-2.0 >= $GLADE_REQUIRED_VERSION)
+	     libglade-2.0 >= $GLADE_REQUIRED_VERSION
+	     gio-2.0 >= $GLIB_REQUIRED_VERSION)
 AC_SUBST(APPLET_CFLAGS)
 AC_SUBST(APPLET_LIBS)
 
