~ubuntu-branches/ubuntu/hardy/gnome-menus/hardy

« back to all changes in this revision

Viewing changes to debian/patches/07_gnomevfs.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-01-07 11:57:06 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20080107115706-eya0xoo45mf53bvn
Tags: 2.21.3-0ubuntu1
* New upstream version:
  - Fix for api change in gio
  - Prevent a major memory leak
* debian/control.in:
  - don't Build-Depends on libgnomevfs2-dev
  - updated libglib requirement
* debian/patches/07_gnomevfs.patch:
  - dropped, not required since the new version use gio
* debian/patches/20_show-admin-tools-for-admin-group.patch:
  - new version update
* debian/patches/70_reautogen.patch:
  - new version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
@@ -39,6 +39,9 @@
6
 
 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0)
7
 
 AC_SUBST(GLIB_CFLAGS)
8
 
 AC_SUBST(GLIB_LIBS)
9
 
+PKG_CHECK_MODULES(GNOMEVFS, gnome-vfs-2.0 >= 2.14)
10
 
+AC_SUBST(GNOMEVFS_CFLAGS)
11
 
+AC_SUBST(GNOMEVFS_LIBS)
12
 
 
13
 
 AC_ARG_ENABLE(inotify,
14
 
               [AC_HELP_STRING([--enable-inotify],
15
 
@@ -56,24 +59,6 @@
16
 
 
17
 
 AM_CONDITIONAL(INOTIFY_SUPPORT, test "x$enable_inotify" = "xyes")
18
 
 
19
 
-if test "x$enable_inotify" != "xyes" ; then
20
 
-  dnl check for FAM
21
 
-  FAM_LIBS=
22
 
-  AC_CHECK_LIB(fam, FAMOpen,
23
 
-    [AC_CHECK_HEADERS(fam.h,
24
 
-      [AC_DEFINE(HAVE_FAM, [], [Define if we have FAM])
25
 
-       FAM_LIBS="-lfam"],
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) ***))
28
 
-  AC_SUBST(FAM_LIBS)
29
 
-
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"
35
 
-fi
36
 
-
37
 
 GNOME_COMPILE_WARNINGS(yes)
38
 
 
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
44
 
@@ -3,6 +3,7 @@
45
 
 INCLUDES =                             \
46
 
        -DGMENU_I_KNOW_THIS_IS_UNSTABLE \
47
 
        $(GLIB_CFLAGS)                  \
48
 
+       $(GNOMEVFS_CFLAGS)              \
49
 
        $(DISABLE_DEPRECATED_CFLAGS)    \
50
 
        $(DEBUG_CFLAGS)                 \
51
 
        $(WARN_CFLAGS)                  \
52
 
@@ -12,10 +13,10 @@
53
 
 
54
 
 if INOTIFY_SUPPORT
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
58
 
 else
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
63
 
 endif
64
 
 
65
 
 libgnome_menu_la_SOURCES =             \
66
 
@@ -39,7 +40,7 @@
67
 
 
68
 
 libgnome_menu_la_LIBADD =              \
69
 
        $(GLIB_LIBS)                    \
70
 
-       $(FAM_LIBS)                     \
71
 
+       $(GNOMEVFS_LIBS)                        \
72
 
        $(NULL)
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
79
 
@@ -0,0 +1,113 @@
80
 
+/*
81
 
+ * Copyright (C) 2005 Red Hat, Inc.
82
 
+ * Copyright (C) 2006 Mark McLoughlin
83
 
+ * Copyright (C) 2006 Josselin Mouette
84
 
+ *
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.
89
 
+ *
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.
94
 
+ *
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.
99
 
+ */
100
 
+
101
 
+#include <libgnomevfs/gnome-vfs-ops.h>
102
 
+#include <libgnomevfs/gnome-vfs-init.h>
103
 
+#include <libgnomevfs/gnome-vfs-utils.h>
104
 
+
105
 
+#include "menu-monitor-backend.h"
106
 
+#include "menu-util.h"
107
 
+
108
 
+
109
 
+static void
110
 
+monitor_callback (GnomeVFSMonitorHandle *handle,
111
 
+                 const gchar *monitor_uri,
112
 
+                 const gchar *info_uri,
113
 
+                 GnomeVFSMonitorEventType event_type,
114
 
+                 gpointer data)
115
 
+{
116
 
+  MenuMonitor *monitor = (MenuMonitor*) data;
117
 
+  MenuMonitorEventInfo *event_info;
118
 
+  MenuMonitorEvent      event;
119
 
+
120
 
+  if (!g_str_has_prefix(info_uri,"file:///"))
121
 
+    {
122
 
+      g_printerr("received non-file uri: %s\n");
123
 
+      g_assert_not_reached ();
124
 
+    }
125
 
+
126
 
+  event = MENU_MONITOR_EVENT_INVALID;
127
 
+  switch (event_type)
128
 
+    {
129
 
+    case GNOME_VFS_MONITOR_EVENT_CHANGED:
130
 
+      event = MENU_MONITOR_EVENT_CHANGED;
131
 
+      break;
132
 
+
133
 
+    case GNOME_VFS_MONITOR_EVENT_CREATED:
134
 
+      event = MENU_MONITOR_EVENT_CREATED;
135
 
+      break;
136
 
+
137
 
+    case GNOME_VFS_MONITOR_EVENT_DELETED:
138
 
+      event = MENU_MONITOR_EVENT_DELETED;
139
 
+      break;
140
 
+
141
 
+    default:
142
 
+      return;
143
 
+    }
144
 
+
145
 
+  event_info = g_new0 (MenuMonitorEventInfo, 1);
146
 
+
147
 
+  event_info->path    = gnome_vfs_get_local_path_from_uri (info_uri);
148
 
+  event_info->event   = event;
149
 
+  event_info->monitor = monitor;
150
 
+
151
 
+  menu_monitor_queue_event (event_info);
152
 
+}
153
 
+
154
 
+void
155
 
+menu_monitor_backend_register_monitor (MenuMonitor *monitor)
156
 
+{
157
 
+  GnomeVFSMonitorHandle *handle;
158
 
+  gchar *uri;
159
 
+  GnomeVFSResult result;
160
 
+
161
 
+  uri = gnome_vfs_get_uri_from_local_path (menu_monitor_get_path (monitor));
162
 
+
163
 
+  if (gnome_vfs_init () != TRUE)
164
 
+    {
165
 
+      menu_verbose ("Failed to initialise gnome-vfs.\n");
166
 
+      return;
167
 
+    }
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);
171
 
+  g_free(uri);
172
 
+
173
 
+  if (result)
174
 
+    {
175
 
+      menu_verbose ("Not adding monitor on '%s': %s\n", menu_monitor_get_path (monitor),
176
 
+                   gnome_vfs_result_to_string(result));
177
 
+      return;
178
 
+    }
179
 
+
180
 
+  menu_monitor_set_backend_data (monitor, handle);
181
 
+}
182
 
+
183
 
+void
184
 
+menu_monitor_backend_unregister_monitor (MenuMonitor *monitor)
185
 
+{
186
 
+  GnomeVFSMonitorHandle *handle;
187
 
+
188
 
+  if ((handle = menu_monitor_get_backend_data (monitor)) != NULL)
189
 
+    {
190
 
+      gnome_vfs_monitor_cancel (handle);
191
 
+    }
192
 
+}