[nautilus/wip/csoriano/destktop-split2: 60/60] nautilus-dnd: request file system info if not available



commit e2e400cec6615aaef5485448e2cbc39662daa1a4
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Apr 4 23:44:59 2016 +0200

    nautilus-dnd: request file system info if not available
    
    We were assuming we had in cache the files used for dnd, but with
    the desktop split that's not longer the case.
    
    What can happens is that we cannot discern whether the drop action
    should be a copy or a move, since Nautilus always performs a move if
    the file system is the same as the dragged files.
    
    To fix it, in a best effort mode, we will request to update the files
    information if it's not available. In future times it will be requested,
    and if the files are not freed, we will have the file system information
    available in order to decide a more appropriate drop action.

 libnautilus-private/nautilus-dnd.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-dnd.c b/libnautilus-private/nautilus-dnd.c
index d28e08d..6269077 100644
--- a/libnautilus-private/nautilus-dnd.c
+++ b/libnautilus-private/nautilus-dnd.c
@@ -355,7 +355,12 @@ check_same_fs (NautilusFile *file1,
 
                if (id1 != NULL && id2 != NULL) {
                        result = (strcmp (id1, id2) == 0);
-               }
+               } else {
+                        /* Make sure we request the info. At least we will able to
+                         * have a better answer when this is done */
+                        nautilus_file_call_when_ready (file1,NAUTILUS_FILE_ATTRIBUTE_INFO, NULL, NULL);
+                        nautilus_file_call_when_ready (file2,NAUTILUS_FILE_ATTRIBUTE_INFO, NULL, NULL);
+                }
 
                g_free (id1);
                g_free (id2);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]