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 759718 - Nautilus uses file name logic on folders for renaming
Nautilus uses file name logic on folders for renaming
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
3.22.x
Other Linux
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 773938 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-12-21 05:02 UTC by ar
Modified: 2016-11-08 18:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rename-file-popover-controller: select entire name for folders (2.29 KB, patch)
2016-11-04 12:04 UTC, Razvan Chitu
none Details | Review
rename-file-popover-controller: select entire name for folders (2.29 KB, patch)
2016-11-04 13:33 UTC, Razvan Chitu
committed Details | Review

Description ar 2015-12-21 05:02:44 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.
Comment 1 Carlos Soriano 2015-12-21 10:51:32 UTC
this is intended as requested by multiple users. So close wontfix.
Comment 2 Ernestas Kulik 2016-11-04 11:22:12 UTC
*** Bug 773938 has been marked as a duplicate of this bug. ***
Comment 3 Ernestas Kulik 2016-11-04 11:23:26 UTC
As mentioned in bug 773938, maybe this could be revisited wrt hidden folders?
Comment 4 Ernestas Kulik 2016-11-04 11:24:43 UTC
(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.
Comment 5 Kaartic 2016-11-04 11:32:08 UTC
I don't get it. This is "intended" by many users. How is this helpful to them ?
Comment 6 Carlos Soriano 2016-11-04 11:42:27 UTC
(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.
Comment 7 Carlos Soriano 2016-11-04 11:51:35 UTC
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.
Comment 8 Razvan Chitu 2016-11-04 12:04:16 UTC
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.
Comment 9 Ernestas Kulik 2016-11-04 12:10:34 UTC
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
Comment 10 Carlos Soriano 2016-11-04 12:45:56 UTC
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)
Comment 11 Ernestas Kulik 2016-11-04 12:51:21 UTC
(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.
Comment 12 Razvan Chitu 2016-11-04 13:33:02 UTC
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.
Comment 13 Ernestas Kulik 2016-11-05 19:30:40 UTC
Review of attachment 339122 [details] [review]:

Comment 14 Ernestas Kulik 2016-11-07 17:36:30 UTC
(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.
Comment 15 Carlos Soriano 2016-11-07 17:41:07 UTC
(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? :)
Comment 16 Ernestas Kulik 2016-11-07 18:37:21 UTC
(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
Comment 17 Razvan Chitu 2016-11-08 18:18:12 UTC
Attachment 339122 [details] pushed as 56736b5 - rename-file-popover-controller: select entire name for folders