python/hypothesis: update to 6.121.0
[oi-userland.git] / components / library / gnome-vfs / patches / gnome-vfs-08-trash-skip-copy.patch
blobeb607da6f312894b57b234887f9b6e7528416080
1 --- gnome-vfs-2.6.0/libgnomevfs/gnome-vfs-xfer.c 2005-04-13 09:09:29.000000000 +0530
2 +++ archana-gnome-vfs-2.6.0/libgnomevfs/gnome-vfs-xfer.c 2005-04-13 10:41:54.819357496 +0530
3 @@ -2115,9 +2115,36 @@ gnome_vfs_xfer_uri_internal (const GList
4 source_uri != NULL;
5 source_uri = source_uri->next, target_uri = target_uri->next) {
6 gboolean same_fs;
7 + gboolean is_local;
8 + char *trash_dir;
9 + GnomeVFSURI *trash_uri;
10 + GnomeVFSFileInfo *file_info;
12 g_assert (target_dir_uri != NULL);
14 + /* For local uris, don't set the move option to copy/remove where remove
15 + * can't be done
16 + */
17 + file_info = gnome_vfs_file_info_new ();
19 + trash_dir = g_strconcat (g_get_home_dir (), "/.Trash", NULL);
20 + trash_uri = gnome_vfs_uri_new (trash_dir);
22 + result = gnome_vfs_get_file_info_uri ((GnomeVFSURI *)(source_uri->data),
23 + file_info,
24 + GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS);
26 + is_local = gnome_vfs_uri_is_local ((GnomeVFSURI *)(source_uri->data));
28 + if (result == GNOME_VFS_OK && ! strcmp (target_dir_uri->text, trash_uri->text)) {
29 + if (is_local && (file_info->permissions & GNOME_VFS_PERM_ACCESS_WRITABLE) != 0) {
30 + goto change_operation_move;
31 + }
32 + else {
33 + goto dont_change_operation_move;
34 + }
35 + }
36 +change_operation_move:
37 result = gnome_vfs_check_same_fs_uris ((GnomeVFSURI *)source_uri->data,
38 target_dir_uri, &same_fs);
40 @@ -2126,6 +2153,10 @@ gnome_vfs_xfer_uri_internal (const GList
43 move &= same_fs;
44 +dont_change_operation_move:
45 + g_free (trash_dir);
46 + gnome_vfs_uri_unref (trash_uri);
47 + gnome_vfs_file_info_unref (file_info);
49 /*}*/