After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780326 - batch rename: If there is a dot in the directory name, all the characters after it are shifted
batch rename: If there is a dot in the directory name, all the characters aft...
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
master
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-20 20:07 UTC by Evgeny Shulgin
Modified: 2017-03-22 17:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
batch rename: Do not consider directory "extensions" (2.52 KB, patch)
2017-03-20 20:13 UTC, Evgeny Shulgin
none Details | Review
batch rename: Do not consider directory "extensions" (2.54 KB, patch)
2017-03-22 16:47 UTC, Evgeny Shulgin
committed Details | Review
Added save button to build log (3.41 KB, patch)
2017-03-22 17:40 UTC, Evgeny Shulgin
none Details | Review

Description Evgeny Shulgin 2017-03-20 20:07:55 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.
Comment 1 Evgeny Shulgin 2017-03-20 20:13:45 UTC
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.
Comment 2 Carlos Soriano 2017-03-22 16:38:05 UTC
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)
Comment 3 Evgeny Shulgin 2017-03-22 16:47:17 UTC
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.
Comment 4 Carlos Soriano 2017-03-22 17:02:32 UTC
Review of attachment 348517 [details] [review]:

looks good, thanks!!!
Comment 5 Carlos Soriano 2017-03-22 17:05:14 UTC
Attachment 348517 [details] pushed as 88d41bb - batch rename: Do not consider directory "extensions"
Comment 6 Evgeny Shulgin 2017-03-22 17:40:44 UTC
Created attachment 348520 [details] [review]
Added save button to build log