GNOME Bugzilla – Bug 780326
batch rename: If there is a dot in the directory name, all the characters after it are shifted
Last modified: 2017-03-22 17:40:44 UTC
With a batch renaming using a template, the extension is removed. That is, if we have a file named "some.txt", after renaming using template "[Original file name]YOLO" we will get "someYOLO.txt", and this is correct. But if we renaming folders with a name where there is a dot and subsequent symbols, these characters will be mistakenly considered an extension. For example, after renaming folders "file" -> "fileYOLO", "FILEZ." -> "FILEZ.YOLO" (is correct), but "org.package.library" -> "org.packageYOLO.library", "project-2.0" -> "project-2YOLO.0", "my.files" -> "myYOLO.files", "extra-0.85" -> "extra-0YOLO.85" (is incorrect) To fix this bug we won't search extension if current NautilusFile is a directory.
Created attachment 348358 [details] [review] batch rename: Do not consider directory "extensions" With a batch renaming using a template, the extension is removed. That is, if we have a file named "some.txt", after renaming using template "[Original file name]YOLO" we will get "someYOLO.txt", and this is correct. But if we renaming folders with a name where there is a dot and subsequent symbols, these characters will be mistakenly considered an extension. For example, after renaming folders "file" -> "fileYOLO", "FILEZ." -> "FILEZ.YOLO" (is correct), but "org.package.library" -> "org.packageYOLO.library", "project-2.0" -> "project-2YOLO.0", "my.files" -> "myYOLO.files", "extra-0.85" -> "extra-0YOLO.85" (is incorrect) To fix this bug we won't search extension if current NautilusFile is a directory.
Review of attachment 348358 [details] [review]: The patch looks almost good! Excellent work. Just a nitpick: ::: src/nautilus-batch-rename-utilities.c @@ +355,2 @@ file_name = nautilus_file_get_display_name (file); + if (!nautilus_file_is_directory(file)) single if's have brackets too (as you did further on in the patch)
Created attachment 348517 [details] [review] batch rename: Do not consider directory "extensions" With a batch renaming using a template, the extension is removed. That is, if we have a file named "some.txt", after renaming using template "[Original file name]YOLO" we will get "someYOLO.txt", and this is correct. But if we renaming folders with a name where there is a dot and subsequent symbols, these characters will be mistakenly considered an extension. For example, after renaming folders "file" -> "fileYOLO", "FILEZ." -> "FILEZ.YOLO" (is correct), but "org.package.library" -> "org.packageYOLO.library", "project-2.0" -> "project-2YOLO.0", "my.files" -> "myYOLO.files", "extra-0.85" -> "extra-0YOLO.85" (is incorrect) To fix this bug we won't search extension if current NautilusFile is a directory.
Review of attachment 348517 [details] [review]: looks good, thanks!!!
Attachment 348517 [details] pushed as 88d41bb - batch rename: Do not consider directory "extensions"
Created attachment 348520 [details] [review] Added save button to build log