~noskcaj/ubuntu/trusty/xfdesktop4/4.11.2-1

« back to all changes in this revision

Viewing changes to debian/patches/0011-Fix-for-moving-files-instead-of-copy-when-src-isn-t-.patch

  • Committer: Package Import Robot
  • Author(s): Lionel Le Folgoc
  • Date: 2012-05-18 22:18:02 UTC
  • mfrom: (3.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20120518221802-htmj6h4apaij25l2
Tags: 4.10.0-1ubuntu1
* Merge from Debian experimental, remaining Ubuntu change:
  - debian/patches/xubuntu_improve-nautilus-interactions.patch: added,
    should prevent nautilus from taking over the desktop if xfdesktop is
    running (and vice-versa).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From dba89439ee41f3cc793b44d9dc3630e3238228db Mon Sep 17 00:00:00 2001
2
 
From: Eric Koegel <eric.koegel@gmail.com>
3
 
Date: Sun, 19 Feb 2012 09:32:01 +0300
4
 
Subject: Fix for moving files instead of copy when src isn't writable
5
 
 
6
 
Fixed a bug where a user drags and drops a file from a folder on the
7
 
same filesystem as the desktop but the src isn't writable by the user
8
 
so they can't delete the src file. The user will still see an error
9
 
message if they explicitly try to move the file via the right click
10
 
drag and drop menu.
11
 
---
12
 
 src/xfdesktop-file-icon-manager.c |   13 +++++++++----
13
 
 1 files changed, 9 insertions(+), 4 deletions(-)
14
 
 
15
 
diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
16
 
index 4a19539..2deb0a1 100644
17
 
--- a/src/xfdesktop-file-icon-manager.c
18
 
+++ b/src/xfdesktop-file-icon-manager.c
19
 
@@ -3097,18 +3097,20 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
20
 
 
21
 
                 /* If the user didn't pick whether to copy or move via
22
 
                  * a GDK_ACTION_ASK then determine if we should move/copy
23
 
-                 * by checking if the files are on the same file system.
24
 
+                 * by checking if the files are on the same filesystem
25
 
+                 * and are writable by the user.
26
 
                  */
27
 
                 if(user_selected_action == FALSE) {
28
 
                     GFileInfo *src_info, *dest_info;
29
 
                     const gchar *src_name, *dest_name;
30
 
+
31
 
                     dest_info = g_file_query_info(base_dest_file,
32
 
-                                                  G_FILE_ATTRIBUTE_ID_FILESYSTEM,
33
 
+                                                  XFDESKTOP_FILE_INFO_NAMESPACE,
34
 
                                                   G_FILE_QUERY_INFO_NONE,
35
 
                                                   NULL,
36
 
                                                   NULL);
37
 
                     src_info = g_file_query_info(file_list->data,
38
 
-                                                 G_FILE_ATTRIBUTE_ID_FILESYSTEM,
39
 
+                                                 XFDESKTOP_FILE_INFO_NAMESPACE,
40
 
                                                  G_FILE_QUERY_INFO_NONE,
41
 
                                                  NULL,
42
 
                                                  NULL);
43
 
@@ -3119,7 +3121,10 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
44
 
                         src_name = g_file_info_get_attribute_string(src_info,
45
 
                                                 G_FILE_ATTRIBUTE_ID_FILESYSTEM);
46
 
 
47
 
-                        if(g_strcmp0(src_name, dest_name) == 0) {
48
 
+                        if((g_strcmp0(src_name, dest_name) == 0)
49
 
+                           && g_file_info_get_attribute_boolean(src_info,
50
 
+                                            G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE))
51
 
+                        {
52
 
                             copy_only = FALSE;
53
 
                             context->action = GDK_ACTION_MOVE;
54
 
                         }
55
 
1.7.9
56