Merge pull request #2595 from xen0l/vnstat
[unleashed-userland.git] / components / gvfs / patches / gvfs-10-dav-rename.patch
blobbc2ad8d0e0d27e0476f5ede1bd036c1352d00a69
1 --- gvfs-1.6.7/client/gdaemonfile.c.orig 2011-11-30 13:50:03.712829325 +0000
2 +++ gvfs-1.6.7/client/gdaemonfile.c 2011-11-30 13:50:27.727022766 +0000
3 @@ -551,6 +551,7 @@
5 typedef void (*AsyncPathCallCallback) (DBusMessage *reply,
6 DBusConnection *connection,
7 + GMountInfo *mount_info,
8 GSimpleAsyncResult *result,
9 GCancellable *cancellable,
10 gpointer callback_data);
11 @@ -565,6 +566,7 @@
12 AsyncPathCallCallback callback;
13 gpointer callback_data;
14 GDestroyNotify notify;
15 + GMountInfo *mount_info;
16 } AsyncPathCall;
18 static void
19 @@ -581,6 +583,8 @@
20 g_object_unref (data->cancellable);
21 if (data->args)
22 dbus_message_unref (data->args);
23 + if (data->mount_info)
24 + g_mount_info_unref (data->mount_info);
25 g_free (data);
28 @@ -605,7 +609,9 @@
29 g_object_weak_ref (G_OBJECT (result), (GWeakNotify)async_path_call_free, data);
30 data->result = NULL;
32 - data->callback (reply, connection,
33 + data->callback (reply,
34 + connection,
35 + data->mount_info,
36 result,
37 data->cancellable,
38 data->callback_data);
39 @@ -634,6 +640,7 @@
40 return;
43 + data->mount_info = g_mount_info_ref (mount_info);
44 message =
45 dbus_message_new_method_call (mount_info->dbus_id,
46 mount_info->object_path,
47 @@ -882,6 +889,7 @@
48 static void
49 query_info_async_cb (DBusMessage *reply,
50 DBusConnection *connection,
51 + GMountInfo *mount_info,
52 GSimpleAsyncResult *result,
53 GCancellable *cancellable,
54 gpointer callback_data)
55 @@ -999,6 +1007,7 @@
56 static void
57 read_async_cb (DBusMessage *reply,
58 DBusConnection *connection,
59 + GMountInfo *mount_info,
60 GSimpleAsyncResult *result,
61 GCancellable *cancellable,
62 gpointer callback_data)
63 @@ -1324,6 +1333,7 @@
64 static void
65 mount_mountable_async_cb (DBusMessage *reply,
66 DBusConnection *connection,
67 + GMountInfo *mount_info,
68 GSimpleAsyncResult *result,
69 GCancellable *cancellable,
70 gpointer callback_data)
71 @@ -1440,6 +1450,7 @@
72 static void
73 start_mountable_async_cb (DBusMessage *reply,
74 DBusConnection *connection,
75 + GMountInfo *mount_info,
76 GSimpleAsyncResult *result,
77 GCancellable *cancellable,
78 gpointer callback_data)
79 @@ -1490,6 +1501,7 @@
80 static void
81 stop_mountable_async_cb (DBusMessage *reply,
82 DBusConnection *connection,
83 + GMountInfo *mount_info,
84 GSimpleAsyncResult *result,
85 GCancellable *cancellable,
86 gpointer callback_data)
87 @@ -1543,6 +1555,7 @@
88 static void
89 eject_mountable_async_cb (DBusMessage *reply,
90 DBusConnection *connection,
91 + GMountInfo *mount_info,
92 GSimpleAsyncResult *result,
93 GCancellable *cancellable,
94 gpointer callback_data)
95 @@ -1613,6 +1626,7 @@
96 static void
97 unmount_mountable_async_cb (DBusMessage *reply,
98 DBusConnection *connection,
99 + GMountInfo *mount_info,
100 GSimpleAsyncResult *result,
101 GCancellable *cancellable,
102 gpointer callback_data)
103 @@ -1665,6 +1679,7 @@
104 static void
105 poll_mountable_async_cb (DBusMessage *reply,
106 DBusConnection *connection,
107 + GMountInfo *mount_info,
108 GSimpleAsyncResult *result,
109 GCancellable *cancellable,
110 gpointer callback_data)
111 @@ -1862,6 +1877,7 @@
112 static void
113 query_fs_info_async_cb (DBusMessage *reply,
114 DBusConnection *connection,
115 + GMountInfo *mount_info,
116 GSimpleAsyncResult *result,
117 GCancellable *cancellable,
118 gpointer callback_data)
119 @@ -2011,21 +2027,26 @@
120 GError **error)
122 GDaemonFile *daemon_file;
123 + GMountInfo *mount_info;
124 DBusMessage *reply;
125 DBusMessageIter iter;
126 char *new_path;
128 daemon_file = G_DAEMON_FILE (file);
130 + mount_info = NULL;
131 reply = do_sync_path_call (file,
132 G_VFS_DBUS_MOUNT_OP_SET_DISPLAY_NAME,
133 - NULL, NULL,
134 + &mount_info, NULL,
135 cancellable, error,
136 DBUS_TYPE_STRING, &display_name,
138 if (reply == NULL)
139 - return NULL;
142 + if (mount_info)
143 + g_mount_info_unref (mount_info);
144 + return NULL;
147 if (!dbus_message_iter_init (reply, &iter) ||
148 !_g_dbus_message_iter_get_args (&iter, NULL,
149 @@ -2037,10 +2058,12 @@
150 goto out;
153 + g_mount_info_apply_prefix (mount_info, &new_path);
154 file = new_file_for_new_path (daemon_file, new_path);
155 g_free (new_path);
157 out:
158 + g_mount_info_unref (mount_info);
159 dbus_message_unref (reply);
160 return file;
162 @@ -2630,6 +2653,7 @@
163 static void
164 append_to_async_cb (DBusMessage *reply,
165 DBusConnection *connection,
166 + GMountInfo *mount_info,
167 GSimpleAsyncResult *result,
168 GCancellable *cancellable,
169 gpointer callback_data)
170 @@ -2714,6 +2738,7 @@
171 static void
172 create_async_cb (DBusMessage *reply,
173 DBusConnection *connection,
174 + GMountInfo *mount_info,
175 GSimpleAsyncResult *result,
176 GCancellable *cancellable,
177 gpointer callback_data)
178 @@ -2796,6 +2821,7 @@
179 static void
180 enumerate_children_async_cb (DBusMessage *reply,
181 DBusConnection *connection,
182 + GMountInfo *mount_info,
183 GSimpleAsyncResult *result,
184 GCancellable *cancellable,
185 gpointer callback_data)
186 @@ -2977,6 +3003,7 @@
187 static void
188 replace_async_cb (DBusMessage *reply,
189 DBusConnection *connection,
190 + GMountInfo *mount_info,
191 GSimpleAsyncResult *result,
192 GCancellable *cancellable,
193 gpointer callback_data)
194 @@ -3058,6 +3085,7 @@
195 static void
196 set_display_name_async_cb (DBusMessage *reply,
197 DBusConnection *connection,
198 + GMountInfo *mount_info,
199 GSimpleAsyncResult *result,
200 GCancellable *cancellable,
201 gpointer callback_data)
202 @@ -3077,7 +3105,9 @@
203 goto out;
206 + g_mount_info_apply_prefix (mount_info, &new_path);
207 file = new_file_for_new_path (daemon_file, new_path);
209 g_free (new_path);
211 g_simple_async_result_set_op_res_gpointer (result, file, g_object_unref);
212 --- gvfs-1.6.7/common/gmounttracker.c.orig 2011-11-30 13:47:20.816889639 +0000
213 +++ gvfs-1.6.7/common/gmounttracker.c 2011-11-30 13:48:12.379029145 +0000
214 @@ -153,6 +153,26 @@
215 return new_path;
218 +void
219 +g_mount_info_apply_prefix (GMountInfo *info,
220 + char **path)
222 + GMountSpec *spec;
224 + spec = info->mount_spec;
226 + if (spec->mount_prefix != NULL &&
227 + spec->mount_prefix[0] != 0)
229 + char *path_with_prefix;
230 + path_with_prefix = g_build_path ("/", spec->mount_prefix,
231 + *path, NULL);
232 + g_free (*path);
233 + *path = path_with_prefix;
238 GMountInfo *
239 g_mount_info_from_dbus (DBusMessageIter *iter)
241 --- gvfs-1.6.7/common/gmounttracker.h.orig 2011-11-30 13:47:30.216834715 +0000
242 +++ gvfs-1.6.7/common/gmounttracker.h 2011-11-30 13:48:09.537242330 +0000
243 @@ -73,6 +73,8 @@
244 void g_mount_info_unref (GMountInfo *info);
245 const char *g_mount_info_resolve_path (GMountInfo *info,
246 const char *path);
247 +void g_mount_info_apply_prefix (GMountInfo *info,
248 + char **path);
250 GMountInfo * g_mount_info_from_dbus (DBusMessageIter *iter);