Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-menus/configure.in,v
retrieving revision 1.75
diff -u -r1.75 configure.in
--- configure.in	22 Aug 2005 08:59:55 -0000	1.75
+++ configure.in	30 Aug 2005 18:33:07 -0000
@@ -37,25 +37,9 @@
 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
 
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0 gnome-vfs-2.0 >= 2.8.0)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
-
-dnl check for FAM
-FAM_LIBS=
-AC_CHECK_LIB(fam, FAMOpen,
-  [AC_CHECK_HEADERS(fam.h,
-    [AC_DEFINE(HAVE_FAM, [], [Define if we have FAM])
-     FAM_LIBS="-lfam"],
-    AC_MSG_WARN(*** FAM support will not be built (header files not found) ***))],
-  AC_MSG_WARN(*** FAM support will not be built (FAM library not found) ***))
-AC_SUBST(FAM_LIBS)
-
-dnl check for gamin extension
-gmenu_save_libs="$LIBS"
-LIBS="$LIBS $FAM_LIBS"
-AC_CHECK_FUNCS(FAMNoExists)
-LIBS="$gmenu_save_libs"
 
 GNOME_COMPILE_WARNINGS(yes)
 
Index: libmenu/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-menus/libmenu/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- libmenu/Makefile.am	8 Jun 2005 15:25:20 -0000	1.5
+++ libmenu/Makefile.am	30 Aug 2005 18:33:07 -0000
@@ -21,15 +21,12 @@
 	gmenu-tree.h			\
 	menu-layout.c			\
 	menu-layout.h			\
-	menu-monitor.c			\
-	menu-monitor.h			\
 	menu-util.c			\
 	menu-util.h			\
 	$(NULL)
 
 libgnome_menu_la_LIBADD = 		\
 	$(GLIB_LIBS)			\
-	$(FAM_LIBS)			\
 	$(NULL)
 libgnome_menu_la_LDFLAGS =			\
 	-version-info $(LIB_MENU_LT_VERSION)	\
Index: libmenu/entry-directories.c
===================================================================
RCS file: /cvs/gnome/gnome-menus/libmenu/entry-directories.c,v
retrieving revision 1.17
diff -u -r1.17 entry-directories.c
--- libmenu/entry-directories.c	22 Aug 2005 08:19:34 -0000	1.17
+++ libmenu/entry-directories.c	30 Aug 2005 18:33:07 -0000
@@ -25,9 +25,9 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <dirent.h>
+#include <libgnomevfs/gnome-vfs.h>
 
 #include "menu-util.h"
-#include "menu-monitor.h"
 #include "canonicalize.h"
 
 typedef struct CachedDir CachedDir;
@@ -58,7 +58,7 @@
   GSList *entries;
   GSList *subdirs;
 
-  MenuMonitor *dir_monitor;
+  GnomeVFSMonitorHandle *dir_monitor;
   GSList      *monitors;
 
   guint have_read_entries : 1;
@@ -78,9 +78,10 @@
 static gboolean cached_dir_load_entries_recursive (CachedDir  *dir,
                                                    const char *dirname);
 
-static void handle_cached_dir_changed (MenuMonitor      *monitor,
-				       MenuMonitorEvent  event,
-				       const char       *path,
+static void handle_cached_dir_changed (GnomeVFSMonitorHandle *monitor,
+				       const gchar *monitor_uri,
+				       const gchar *info_user,
+				       GnomeVFSMonitorEventType event_type,
 				       CachedDir        *dir);
 
 /*
@@ -106,10 +107,7 @@
 {
   if (dir->dir_monitor)
     {
-      menu_monitor_remove_notify (dir->dir_monitor,
-				  (MenuMonitorNotifyFunc) handle_cached_dir_changed,
-				  dir);
-      menu_monitor_unref (dir->dir_monitor);
+      gnome_vfs_monitor_cancel (dir->dir_monitor);
       dir->dir_monitor = NULL;
     }
 
@@ -398,21 +396,25 @@
     }
 }
 
-static void
-handle_cached_dir_changed (MenuMonitor      *monitor,
-			   MenuMonitorEvent  event,
-			   const char       *path,
-                           CachedDir        *dir)
+
+static void 
+handle_cached_dir_changed (GnomeVFSMonitorHandle *monitor,
+			   const gchar *monitor_uri,
+			   const gchar *info_uri,
+			   GnomeVFSMonitorEventType event_type,
+			   CachedDir        *dir)
 {
   gboolean  handled = FALSE;
+  char     *path;
   char     *basename;
   char     *dirname;
 
+  path = gnome_vfs_get_local_path_from_uri (info_uri);
   menu_verbose ("'%s' notified of '%s' %s - invalidating cache\n",
 		dir->name,
                 path,
-                event == MENU_MONITOR_EVENT_CREATED ? ("created") :
-                event == MENU_MONITOR_EVENT_DELETED ? ("deleted") : ("changed"));
+                event_type == GNOME_VFS_MONITOR_EVENT_CREATED ? ("created") :
+                event_type == GNOME_VFS_MONITOR_EVENT_DELETED ? ("deleted") : ("changed"));
 
   dirname  = g_path_get_dirname  (path);
   basename = g_path_get_basename (path);
@@ -422,14 +424,14 @@
   if (g_str_has_suffix (basename, ".desktop") ||
       g_str_has_suffix (basename, ".directory"))
     {
-      switch (event)
+      switch (event_type)
         {
-        case MENU_MONITOR_EVENT_CREATED:
-        case MENU_MONITOR_EVENT_CHANGED:
+        case GNOME_VFS_MONITOR_EVENT_CREATED:
+        case GNOME_VFS_MONITOR_EVENT_CHANGED:
           handled = cached_dir_update_entry (dir, basename, path);
           break;
 
-        case MENU_MONITOR_EVENT_DELETED:
+        case GNOME_VFS_MONITOR_EVENT_DELETED:
           handled = cached_dir_remove_entry (dir, basename);
           break;
 
@@ -440,16 +442,16 @@
     }
   else /* Try recursing */
     {
-      switch (event)
+      switch (event_type)
         {
-        case MENU_MONITOR_EVENT_CREATED:
+        case GNOME_VFS_MONITOR_EVENT_CREATED:
           handled = cached_dir_add_subdir (dir, basename, path);
           break;
 
-        case MENU_MONITOR_EVENT_CHANGED:
+        case GNOME_VFS_MONITOR_EVENT_CHANGED:
           break;
 
-        case MENU_MONITOR_EVENT_DELETED:
+        case GNOME_VFS_MONITOR_EVENT_DELETED:
           handled = cached_dir_remove_subdir (dir, basename);
           break;
 
@@ -461,6 +463,7 @@
 
   g_free (basename);
   g_free (dirname);
+  g_free (path);
 
   if (handled)
     {
@@ -474,10 +477,10 @@
 {
   if (dir->dir_monitor == NULL)
     {
-      dir->dir_monitor = menu_get_directory_monitor (dirname);
-      menu_monitor_add_notify (dir->dir_monitor,
-			       (MenuMonitorNotifyFunc) handle_cached_dir_changed,
-			       dir);
+      gnome_vfs_monitor_add (&(dir->dir_monitor), dirname, 
+							 GNOME_VFS_MONITOR_DIRECTORY,
+							 (GnomeVFSMonitorCallback) handle_cached_dir_changed,
+							 dir);
     }
 }
 
Index: libmenu/gmenu-tree.c
===================================================================
RCS file: /cvs/gnome/gnome-menus/libmenu/gmenu-tree.c,v
retrieving revision 1.37
diff -u -r1.37 gmenu-tree.c
--- libmenu/gmenu-tree.c	25 Jul 2005 10:53:55 -0000	1.37
+++ libmenu/gmenu-tree.c	30 Aug 2005 18:33:08 -0000
@@ -23,9 +23,9 @@
 
 #include <string.h>
 #include <errno.h>
+#include <libgnomevfs/gnome-vfs.h>
 
 #include "menu-layout.h"
-#include "menu-monitor.h"
 #include "menu-util.h"
 #include "canonicalize.h"
 
@@ -252,77 +252,83 @@
 
   return retval ? gmenu_tree_ref (retval) : NULL;
 }
-
-typedef enum
-{
-  MENU_FILE_MONITOR_INVALID = 0,
-  MENU_FILE_MONITOR_FILE,
-  MENU_FILE_MONITOR_NONEXISTENT_FILE,
-  MENU_FILE_MONITOR_DIRECTORY
-} MenuFileMonitorType;
-
 typedef struct
 {
-  MenuFileMonitorType  type;
-  MenuMonitor         *monitor;
+  GnomeVFSMonitorType    type;
+  GnomeVFSMonitorHandle *monitor;
 } MenuFileMonitor;
 
 static void
-handle_nonexistent_menu_file_changed (MenuMonitor      *monitor,
-				      MenuMonitorEvent  event,
-				      const char       *path,
+handle_nonexistent_menu_file_changed (GnomeVFSMonitorHandle *monitor,
+				      const gchar *monitor_uri,
+				      const gchar *info_uri,
+				      GnomeVFSMonitorEventType event,
 				      GMenuTree        *tree)
 {
-  if (event == MENU_MONITOR_EVENT_CHANGED ||
-      event == MENU_MONITOR_EVENT_CREATED)
+  gchar *path = gnome_vfs_get_local_path_from_uri (info_uri);
+
+  if (event == GNOME_VFS_MONITOR_EVENT_CHANGED ||
+      event == GNOME_VFS_MONITOR_EVENT_CREATED)
     {
       menu_verbose ("\"%s\" %s, marking tree for recanonicalization\n",
                     path,
-                    event == MENU_MONITOR_EVENT_CREATED ? "created" : "changed");
+                    event == GNOME_VFS_MONITOR_EVENT_CREATED ? "created" : "changed");
 
       gmenu_tree_force_recanonicalize (tree);
       gmenu_tree_invoke_monitors (tree);
     }
+
+  g_free (path);
 }
 
 static void
-handle_menu_file_changed (MenuMonitor      *monitor,
-			  MenuMonitorEvent  event,
-			  const char       *path,
-                          GMenuTree        *tree)
+handle_menu_file_changed (GnomeVFSMonitorHandle *monitor,
+			  const gchar *monitor_uri,
+			  const gchar *info_uri,
+			  GnomeVFSMonitorEventType event,
+			  GMenuTree        *tree)
 {
+  gchar *path = gnome_vfs_get_local_path_from_uri (info_uri);
   menu_verbose ("\"%s\" %s, marking tree for recanicalization\n",
 		path,
-		event == MENU_MONITOR_EVENT_CREATED ? "created" :
-		event == MENU_MONITOR_EVENT_CHANGED ? "changed" : "deleted");
+		event == GNOME_VFS_MONITOR_EVENT_CREATED ? "created" :
+		event == GNOME_VFS_MONITOR_EVENT_CHANGED ? "changed" : "deleted");
 
   gmenu_tree_force_recanonicalize (tree);
   gmenu_tree_invoke_monitors (tree);
+  g_free (path);
 }
 
 static void
-handle_menu_file_directory_changed (MenuMonitor      *monitor,
-				    MenuMonitorEvent  event,
-				    const char       *path,
-				    GMenuTree        *tree)
+handle_menu_file_directory_changed (GnomeVFSMonitorHandle *monitor,
+			  const gchar *monitor_uri,
+			  const gchar *info_uri,
+			  GnomeVFSMonitorEventType event,
+			  GMenuTree        *tree)
+
 {
-  if (!g_str_has_suffix (path, ".menu"))
+  gchar *path = gnome_vfs_get_local_path_from_uri (info_uri);
+  if (!g_str_has_suffix (path, ".menu")) {
+    g_free (path);
     return;
+  }
 
   menu_verbose ("\"%s\" %s, marking tree for recanicalization\n",
 		path,
-		event == MENU_MONITOR_EVENT_CREATED ? "created" :
-		event == MENU_MONITOR_EVENT_CHANGED ? "changed" : "deleted");
+		event == GNOME_VFS_MONITOR_EVENT_CREATED ? "created" :
+		event == GNOME_VFS_MONITOR_EVENT_CHANGED ? "changed" : "deleted");
 
   gmenu_tree_force_recanonicalize (tree);
   gmenu_tree_invoke_monitors (tree);
+  g_free (path);
 }
 
 static void
 gmenu_tree_add_menu_file_monitor (GMenuTree           *tree,
 				  const char          *path,
-				  MenuFileMonitorType  type)
+				  GnomeVFSMonitorType  type)
 {
+  gchar *uri = gnome_vfs_get_uri_from_local_path (path);
   MenuFileMonitor *monitor;
 
   monitor = g_new0 (MenuFileMonitor, 1);
@@ -331,15 +337,14 @@
 
   switch (type)
     {
-    case MENU_FILE_MONITOR_FILE:
+    case GNOME_VFS_MONITOR_FILE:
       menu_verbose ("Adding a menu file monitor for \"%s\"\n", path);
-
-      monitor->monitor = menu_get_file_monitor (path);
-      menu_monitor_add_notify (monitor->monitor,
-			       (MenuMonitorNotifyFunc) handle_menu_file_changed,
-			       tree);
+      gnome_vfs_monitor_add (&(monitor->monitor), uri, GNOME_VFS_MONITOR_FILE,
+			     (GnomeVFSMonitorCallback) handle_menu_file_changed,
+			     tree);
       break;
 
+#if 0
     case MENU_FILE_MONITOR_NONEXISTENT_FILE:
       menu_verbose ("Adding a menu file monitor for non-existent \"%s\"\n", path);
 
@@ -348,14 +353,13 @@
 			       (MenuMonitorNotifyFunc) handle_nonexistent_menu_file_changed,
 			       tree);
       break;
+#endif
 
-    case MENU_FILE_MONITOR_DIRECTORY:
+    case GNOME_VFS_MONITOR_DIRECTORY:
       menu_verbose ("Adding a menu directory monitor for \"%s\"\n", path);
-
-      monitor->monitor = menu_get_directory_monitor (path);
-      menu_monitor_add_notify (monitor->monitor,
-			       (MenuMonitorNotifyFunc) handle_menu_file_directory_changed,
-			       tree);
+      gnome_vfs_monitor_add (&(monitor->monitor), uri, GNOME_VFS_MONITOR_DIRECTORY,
+			     (GnomeVFSMonitorCallback) handle_menu_file_directory_changed,
+			     tree);
       break;
 
     default:
@@ -364,42 +368,15 @@
     }
 
   tree->menu_file_monitors = g_slist_prepend (tree->menu_file_monitors, monitor);
+  g_free (uri);
 }
 
 static void
 remove_menu_file_monitor (MenuFileMonitor *monitor,
 			  GMenuTree       *tree)
 {
-  switch (monitor->type)
-    {
-    case MENU_FILE_MONITOR_FILE:
-      menu_monitor_remove_notify (monitor->monitor,
-				  (MenuMonitorNotifyFunc) handle_menu_file_changed,
-				  tree);
-      break;
-
-    case MENU_FILE_MONITOR_NONEXISTENT_FILE:
-      menu_monitor_remove_notify (monitor->monitor,
-				  (MenuMonitorNotifyFunc) handle_nonexistent_menu_file_changed,
-				  tree);
-      break;
-
-    case MENU_FILE_MONITOR_DIRECTORY:
-      menu_monitor_remove_notify (monitor->monitor,
-				  (MenuMonitorNotifyFunc) handle_menu_file_directory_changed,
-				  tree);
-      break;
-
-    default:
-      g_assert_not_reached ();
-      break;
-    }
-
-  menu_monitor_unref (monitor->monitor);
+  gnome_vfs_monitor_cancel (monitor->monitor);
   monitor->monitor = NULL;
-
-  monitor->type = MENU_FILE_MONITOR_INVALID;
-
   g_free (monitor);
 }
 
@@ -478,13 +455,13 @@
       tree->canonical = TRUE;
       gmenu_tree_add_menu_file_monitor (tree,
 					tree->canonical_path,
-					MENU_FILE_MONITOR_FILE);
+					GNOME_VFS_MONITOR_FILE);
     }
   else
     {
       gmenu_tree_add_menu_file_monitor (tree,
 					path,
-					MENU_FILE_MONITOR_NONEXISTENT_FILE);
+					GNOME_VFS_MONITOR_FILE);
     }
 
   g_free (path);
@@ -549,7 +526,7 @@
           gmenu_tree_remove_menu_file_monitors (tree);
           gmenu_tree_add_menu_file_monitor (tree,
 					    tree->canonical_path,
-					    MENU_FILE_MONITOR_FILE);
+					    GNOME_VFS_MONITOR_FILE);
 
           tree->canonical = TRUE;
 
@@ -630,13 +607,13 @@
 	  tree->canonical_path = g_strdup (menu_file);
 	  gmenu_tree_add_menu_file_monitor (tree,
 					    tree->canonical_path,
-					    MENU_FILE_MONITOR_FILE);
+					    GNOME_VFS_MONITOR_FILE);
 	}
       else
 	{
 	  gmenu_tree_add_menu_file_monitor (tree,
 					    tree->absolute_path,
-					    MENU_FILE_MONITOR_NONEXISTENT_FILE);
+					    GNOME_VFS_MONITOR_FILE);
 	}
     }
 
@@ -1602,7 +1579,7 @@
 	  if (add_monitor)
 	    gmenu_tree_add_menu_file_monitor (tree,
 					     filename,
-					     MENU_FILE_MONITOR_NONEXISTENT_FILE);
+					     GNOME_VFS_MONITOR_FILE);
 
           menu_verbose ("Failed to canonicalize merge file path \"%s\": %s\n",
                         filename, g_strerror (errno));
@@ -1639,7 +1616,7 @@
   if (add_monitor)
     gmenu_tree_add_menu_file_monitor (tree,
 				      canonical,
-				      MENU_FILE_MONITOR_FILE);
+				      GNOME_VFS_MONITOR_FILE);
 
   merge_resolved_children (tree, loaded_menu_files, where, to_merge);
 
@@ -1783,7 +1760,7 @@
 
   gmenu_tree_add_menu_file_monitor (tree,
 				    dirname,
-				    MENU_FILE_MONITOR_DIRECTORY);
+				    GNOME_VFS_MONITOR_DIRECTORY);
 
   if ((dir = g_dir_open (dirname, 0, NULL)) == NULL)
     return;
