[nautilus] file: Let renames work on Google Drive



commit fe6bec3a03b219f0a5036b0d388c5a37c132b3dc
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Nov 19 19:14:03 2014 +0100

    file: Let renames work on Google Drive
    
    Renaming an item on Google Drive does not change the actual GVfs path
    because the path is made up of document-ids, which do not change. A
    rename operation only affects the title of the entry. In GIO terms,
    only the standard::display-name changes, but the standard::name remains
    the same.
    
    Therefore, if there is already a file with the same standard::name,
    then don't mark it as gone if it is the same file that we are renaming.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740383

 libnautilus-private/nautilus-file.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index c466ff9..a22fded 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -1732,10 +1732,11 @@ rename_get_info_callback (GObject *source_object,
                new_name = g_file_info_get_name (new_info);
                
                /* If there was another file by the same name in this
-                * directory, mark it gone.
+                * directory and it is not the same file that we are
+                * renaming, mark it gone.
                 */
                existing_file = nautilus_directory_find_file_by_name (directory, new_name);
-               if (existing_file != NULL) {
+               if (existing_file != NULL && existing_file != op->file) {
                        nautilus_file_mark_gone (existing_file);
                        nautilus_file_changed (existing_file);
                }


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