1
Index: gnome-menus-2.18.3/configure.in
2
===================================================================
3
--- gnome-menus-2.18.3.orig/configure.in 2007-07-02 19:16:04.000000000 +0200
4
+++ gnome-menus-2.18.3/configure.in 2007-07-17 18:45:33.894184102 +0200
6
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0)
9
+PKG_CHECK_MODULES(GNOMEVFS, gnome-vfs-2.0 >= 2.14)
10
+AC_SUBST(GNOMEVFS_CFLAGS)
11
+AC_SUBST(GNOMEVFS_LIBS)
13
AC_ARG_ENABLE(inotify,
14
[AC_HELP_STRING([--enable-inotify],
17
AM_CONDITIONAL(INOTIFY_SUPPORT, test "x$enable_inotify" = "xyes")
19
-if test "x$enable_inotify" != "xyes" ; then
22
- AC_CHECK_LIB(fam, FAMOpen,
23
- [AC_CHECK_HEADERS(fam.h,
24
- [AC_DEFINE(HAVE_FAM, [], [Define if we have FAM])
26
- AC_MSG_WARN(*** FAM support will not be built (header files not found) ***))],
27
- AC_MSG_WARN(*** FAM support will not be built (FAM library not found) ***))
30
- dnl check for gamin extension
31
- gmenu_save_libs="$LIBS"
32
- LIBS="$LIBS $FAM_LIBS"
33
- AC_CHECK_FUNCS(FAMNoExists)
34
- LIBS="$gmenu_save_libs"
37
GNOME_COMPILE_WARNINGS(yes)
39
AC_ARG_ENABLE(deprecations,
40
Index: gnome-menus-2.18.3/libmenu/Makefile.am
41
===================================================================
42
--- gnome-menus-2.18.3.orig/libmenu/Makefile.am 2007-07-02 19:15:26.000000000 +0200
43
+++ gnome-menus-2.18.3/libmenu/Makefile.am 2007-07-17 18:45:33.894184102 +0200
46
-DGMENU_I_KNOW_THIS_IS_UNSTABLE \
48
+ $(GNOMEVFS_CFLAGS) \
49
$(DISABLE_DEPRECATED_CFLAGS) \
55
MONITOR_BACKEND_SOURCES = menu-monitor-inotify.c
56
-MONITOR_BACKEND_EX_DIST = menu-monitor-fam.c
57
+MONITOR_BACKEND_EX_DIST = menu-monitor-gnomevfs.c menu-monitor-fam.c
59
-MONITOR_BACKEND_SOURCES = menu-monitor-fam.c
60
-MONITOR_BACKEND_EX_DIST = menu-monitor-inotify.c
61
+MONITOR_BACKEND_SOURCES = menu-monitor-gnomevfs.c
62
+MONITOR_BACKEND_EX_DIST = menu-monitor-inotify.c menu-monitor-fam.c
65
libgnome_menu_la_SOURCES = \
68
libgnome_menu_la_LIBADD = \
73
libgnome_menu_la_LDFLAGS = \
74
-version-info $(LIB_MENU_LT_VERSION) \
75
Index: gnome-menus-2.18.3/libmenu/menu-monitor-gnomevfs.c
76
===================================================================
77
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
78
+++ gnome-menus-2.18.3/libmenu/menu-monitor-gnomevfs.c 2007-07-17 18:45:33.898184330 +0200
81
+ * Copyright (C) 2005 Red Hat, Inc.
82
+ * Copyright (C) 2006 Mark McLoughlin
83
+ * Copyright (C) 2006 Josselin Mouette
85
+ * This library is free software; you can redistribute it and/or
86
+ * modify it under the terms of the GNU Lesser General Public
87
+ * License as published by the Free Software Foundation; either
88
+ * version 2 of the License, or (at your option) any later version.
90
+ * This library is distributed in the hope that it will be useful,
91
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
92
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
93
+ * Lesser General Public License for more details.
95
+ * You should have received a copy of the GNU Lesser General Public
96
+ * License along with this library; if not, write to the
97
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
98
+ * Boston, MA 02111-1307, USA.
101
+#include <libgnomevfs/gnome-vfs-ops.h>
102
+#include <libgnomevfs/gnome-vfs-init.h>
103
+#include <libgnomevfs/gnome-vfs-utils.h>
105
+#include "menu-monitor-backend.h"
106
+#include "menu-util.h"
110
+monitor_callback (GnomeVFSMonitorHandle *handle,
111
+ const gchar *monitor_uri,
112
+ const gchar *info_uri,
113
+ GnomeVFSMonitorEventType event_type,
116
+ MenuMonitor *monitor = (MenuMonitor*) data;
117
+ MenuMonitorEventInfo *event_info;
118
+ MenuMonitorEvent event;
120
+ if (!g_str_has_prefix(info_uri,"file:///"))
122
+ g_printerr("received non-file uri: %s\n");
123
+ g_assert_not_reached ();
126
+ event = MENU_MONITOR_EVENT_INVALID;
127
+ switch (event_type)
129
+ case GNOME_VFS_MONITOR_EVENT_CHANGED:
130
+ event = MENU_MONITOR_EVENT_CHANGED;
133
+ case GNOME_VFS_MONITOR_EVENT_CREATED:
134
+ event = MENU_MONITOR_EVENT_CREATED;
137
+ case GNOME_VFS_MONITOR_EVENT_DELETED:
138
+ event = MENU_MONITOR_EVENT_DELETED;
145
+ event_info = g_new0 (MenuMonitorEventInfo, 1);
147
+ event_info->path = gnome_vfs_get_local_path_from_uri (info_uri);
148
+ event_info->event = event;
149
+ event_info->monitor = monitor;
151
+ menu_monitor_queue_event (event_info);
155
+menu_monitor_backend_register_monitor (MenuMonitor *monitor)
157
+ GnomeVFSMonitorHandle *handle;
159
+ GnomeVFSResult result;
161
+ uri = gnome_vfs_get_uri_from_local_path (menu_monitor_get_path (monitor));
163
+ if (gnome_vfs_init () != TRUE)
165
+ menu_verbose ("Failed to initialise gnome-vfs.\n");
168
+ result = gnome_vfs_monitor_add (&handle, uri,
169
+ menu_monitor_get_is_directory (monitor) ? GNOME_VFS_MONITOR_DIRECTORY : GNOME_VFS_MONITOR_FILE,
170
+ monitor_callback, monitor);
175
+ menu_verbose ("Not adding monitor on '%s': %s\n", menu_monitor_get_path (monitor),
176
+ gnome_vfs_result_to_string(result));
180
+ menu_monitor_set_backend_data (monitor, handle);
184
+menu_monitor_backend_unregister_monitor (MenuMonitor *monitor)
186
+ GnomeVFSMonitorHandle *handle;
188
+ if ((handle = menu_monitor_get_backend_data (monitor)) != NULL)
190
+ gnome_vfs_monitor_cancel (handle);