[nautilus] nautilus-file-undo-operations.c: Use base file name for template redo



commit f8f1e6c0460f8d029879c08cca14a4917e8f97a7
Author: Gary Li <gary li1 uwaterloo ca>
Date:   Sun Sep 18 13:30:47 2022 -0400

    nautilus-file-undo-operations.c: Use base file name for template redo
    
    Currently, Nautilus crashes for redo operations after undoing a template create.
    
    This is because we are passing the parse path, but we expect the base name for the redo operation.
    
    To fix this, use g_file_get_basename instead of g_file_get_parse_name.
    
    Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2344

 src/nautilus-file-undo-operations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/nautilus-file-undo-operations.c b/src/nautilus-file-undo-operations.c
index 7fc6ecd2d..962f7f49e 100644
--- a/src/nautilus-file-undo-operations.c
+++ b/src/nautilus-file-undo-operations.c
@@ -872,7 +872,7 @@ create_from_template_redo_func (NautilusFileUndoInfoCreate     *self,
 
     parent = g_file_get_parent (self->target_file);
     parent_uri = g_file_get_uri (parent);
-    new_name = g_file_get_parse_name (self->target_file);
+    new_name = g_file_get_basename (self->target_file);
     nautilus_file_operations_new_file_from_template (NULL,
                                                      parent_uri, new_name,
                                                      self->template,


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