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 754616 - trying to rename a file with a / report an error "Folder names cannot contain /"
trying to rename a file with a / report an error "Folder names cannot contain /"
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
3.17.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-05 19:59 UTC by Baptiste Mille-Mathias
Modified: 2015-09-10 15:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
not-working patch (2.24 KB, patch)
2015-09-05 21:15 UTC, Baptiste Mille-Mathias
none Details | Review
Pass proper type of target in validate_filename (1.61 KB, patch)
2015-09-08 18:51 UTC, Baptiste Mille-Mathias
none Details | Review
Correct commit message (1.93 KB, patch)
2015-09-09 16:31 UTC, Baptiste Mille-Mathias
committed Details | Review

Description Baptiste Mille-Mathias 2015-09-05 19:59:10 UTC
Whether it is a folder or a file, if a / is inserted in the rename dialog, the message returned is "Folder names cannot contain".

I think I spot the error in src/natilus-files-view.c, validate_file_name is always called with is_folder set to TRUE
Comment 1 Carlos Soriano 2015-09-05 20:06:12 UTC
Indeed, do you wank to make a patch?
Comment 2 Baptiste Mille-Mathias 2015-09-05 21:15:53 UTC
Created attachment 310725 [details] [review]
not-working patch

Not working patch :/

I added a check with validate_file_name but it seems it doesn't solve the problem despite is_folder is properly set accordingly.

If you some advices.
Comment 3 Carlos Soriano 2015-09-08 07:56:33 UTC
So, existing_file is to check if there is a file duplicated. The file that is being renamed is pointed by the data->target file. So you need to check that one =)
Comment 4 Carlos Soriano 2015-09-08 09:11:01 UTC
And fwiw, if you want interactive help, don't hesitate to go to IRC #nautilus channel and reach me :)
Comment 5 Baptiste Mille-Mathias 2015-09-08 18:51:15 UTC
Hi Carlos,

Thanks for the help. I found the data->target_is_folder is what I wanted to use.
Patch coming
Comment 6 Baptiste Mille-Mathias 2015-09-08 18:51:51 UTC
Created attachment 310930 [details] [review]
Pass proper type of target in validate_filename
Comment 7 Carlos Soriano 2015-09-09 12:35:12 UTC
Review of attachment 310930 [details] [review]:

Code looks good thanks!
The commit message is not good though, can you follow the Gnome guidelines for it?
https://wiki.gnome.org/GnomeLove/CodeContributionWorkflow#Commit_guidelines
Comment 8 Baptiste Mille-Mathias 2015-09-09 16:31:43 UTC
Created attachment 311008 [details] [review]
Correct commit message
Comment 9 Carlos Soriano 2015-09-10 13:54:34 UTC
Review of attachment 311008 [details] [review]:

Commit message now looks good except that on the first line you need to put the file affected:
"files-view: ass proper type of file to validate_file_name"
You can commit with that nit fixed.

Thanks for the work!
Comment 10 Baptiste Mille-Mathias 2015-09-10 15:47:04 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.