GNOME Bugzilla – Bug 759718
Nautilus uses file name logic on folders for renaming
Last modified: 2016-11-08 18:18:16 UTC
Renaming a folder should initially select the entire name, and not remove any fictional "extensions" as it does currently. Eg, folders named "foo.tar.bz2" will atm only have the "foo" selected.
this is intended as requested by multiple users. So close wontfix.
*** Bug 773938 has been marked as a duplicate of this bug. ***
As mentioned in bug 773938, maybe this could be revisited wrt hidden folders?
(In reply to Ernestas Kulik from comment #3) > As mentioned in bug 773938, maybe this could be revisited wrt hidden folders? Oops, sorry, misinterpreted that.
I don't get it. This is "intended" by many users. How is this helpful to them ?
(In reply to Kaartic from comment #5) > I don't get it. This is "intended" by many users. How is this helpful to > them ? Because the most common case for them is to rename the name, not the extension. This is how it's helpful for them, selecting the part of the name that can they most probably want to substitute so they can just start typing right ahead.
ok sorry, I misunderstood the bug report entirely. I though this was about the files in general, not specifically the folders. Yes, you are right, it's more correct if we only apply it to files.
Created attachment 339111 [details] [review] rename-file-popover-controller: select entire name for folders When renaming a file, the extension is not selected for editing, even if the file is a directory. In order to fix this, deselect the extension only if the renamed file is not a directory.
Review of attachment 339111 [details] [review]: Aw, it was a perfectly good newcomers bug, too. LGTM, thanks! ::: src/nautilus-rename-file-popover-controller.c @@ +202,3 @@ + if (!nautilus_file_is_directory (target_file)) + { + /* Select the name part withouth the file extension */ You want to preserve the typo for future generations? :p
Review of attachment 339111 [details] [review]: ::: src/nautilus-rename-file-popover-controller.c @@ +200,3 @@ gtk_popover_popup (GTK_POPOVER (rename_file_popover)); + if (!nautilus_file_is_directory (target_file)) use nautilus_file_is_regular_file. I think we want to act in extensions only for regular files. (the desktop links shouldn't use an extension at all)
(In reply to Carlos Soriano from comment #10) > Review of attachment 339111 [details] [review] [review]: > > ::: src/nautilus-rename-file-popover-controller.c > @@ +200,3 @@ > gtk_popover_popup (GTK_POPOVER (rename_file_popover)); > > + if (!nautilus_file_is_directory (target_file)) > > use nautilus_file_is_regular_file. I think we want to act in extensions > only for regular files. (the desktop links shouldn't use an extension at all) True, it probably does make sense to target only regular files. I keep thinking about G_FILE_TYPE_SYMBOLIC_LINK, but those are also regular, according to GVfs.
Created attachment 339122 [details] [review] rename-file-popover-controller: select entire name for folders When renaming a file, the extension is not selected for editing, even if the file is a directory. In order to fix this, deselect the extension only if the renamed file is of regular type.
Review of attachment 339122 [details] [review]:
(In reply to Ernestas Kulik from comment #13) > Review of attachment 339122 [details] [review] [review]: Aw, it’s not showing. :( Anyway, it looks good to me.
(In reply to Ernestas Kulik from comment #14) > (In reply to Ernestas Kulik from comment #13) > > Review of attachment 339122 [details] [review] [review] [review]: > > Aw, it’s not showing. :( > Anyway, it looks good to me. A web service that doesn't handle correctly Unicode and cannot have inline images, nice eh? :)
(In reply to Carlos Soriano from comment #15) > (In reply to Ernestas Kulik from comment #14) > > (In reply to Ernestas Kulik from comment #13) > > > Review of attachment 339122 [details] [review] [review] [review] [review]: > > > > Aw, it’s not showing. :( > > Anyway, it looks good to me. > > A web service that doesn't handle correctly Unicode and cannot have inline > images, nice eh? :) https://www.bugzilla.org/features/#unicode ALL OF IT IS LIES
Attachment 339122 [details] pushed as 56736b5 - rename-file-popover-controller: select entire name for folders