[nautilus] file: mark file with error on batch rename as skipped



commit 7ff0940a0688ff3700a85d1e7219d2992cc42fd0
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date:   Wed Sep 21 14:25:03 2016 +0300

    file: mark file with error on batch rename as skipped
    
    Files that give an error on renaming shouldn't be added to the undo
    list, so those should be marked as skipped.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771487

 src/nautilus-file.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index ef59757..b516011 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -2303,10 +2303,6 @@ real_batch_rename (GList                         *files,
 
             continue;
         }
-        else
-        {
-            old_files = g_list_append (old_files, location);
-        }
 
         g_assert (G_IS_FILE (location));
 
@@ -2320,8 +2316,6 @@ real_batch_rename (GList                         *files,
         data->op = op;
         data->file = file;
 
-        new_files = g_list_append (new_files, new_file);
-
         g_file_query_info_async (new_file,
                                  NAUTILUS_FILE_DEFAULT_ATTRIBUTES,
                                  0,
@@ -2335,6 +2329,13 @@ real_batch_rename (GList                         *files,
             g_warning ("Batch rename for file \"%s\" failed", nautilus_file_get_name (file));
             g_error_free (error);
             error = NULL;
+
+            op->skipped_files++;
+        }
+        else
+        {
+            old_files = g_list_append (old_files, location);
+            new_files = g_list_append (new_files, new_file);
         }
     }
 


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