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 342819 - Renaming "file" to ".file" doesn't update the label
Renaming "file" to ".file" doesn't update the label
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: Icon View
3.16.x
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 389812 607680 706255 725461 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-05-24 16:29 UTC by NoWhereMan
Modified: 2016-03-02 18:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
342819-remove-file-icon-when-renamed-to-hidden-file.patch (617 bytes, patch)
2008-04-17 12:22 UTC, Paweł Paprota
needs-work Details | Review
342819-show-file-icon-when-renamed-to-hidden-file-until-refresh.patch (2.35 KB, patch)
2008-04-20 19:44 UTC, Paweł Paprota
needs-work Details | Review
Fix for the issue (3.85 KB, patch)
2013-09-08 16:24 UTC, Nelson Benitez
needs-work Details | Review
files-view: hide hidden files when renamed (1.61 KB, patch)
2016-03-02 18:11 UTC, Carlos Soriano
committed Details | Review

Description NoWhereMan 2006-05-24 16:29:38 UTC
Please describe the problem:
Renaming a file to .file (a hidden name) doesn't change the icon label, showing
"file", until another attempt to rename the file occurs.


Steps to reproduce:
1. F2 to rename myfile to .myfile
2. Press enter: name is still "myfile"
3. F2 to re-enter "rename mode": name is still "myfile"
4. Press enter: name has become ".myfile"


Actual results:


Expected results:
Name should change from myfile into .myfile once enter has been pressed the
first time

Does this happen every time?
This happens every time

Other information:
Comment 1 Fabio Bonelli 2006-05-24 17:23:15 UTC
Confirming.
Comment 2 Cosimo Cecchi 2008-01-12 12:26:46 UTC
Still there, but in 2.21.2 this only happens in Spatial mode and on the Desktop.
Comment 3 Paweł Paprota 2008-04-17 12:22:38 UTC
Created attachment 109415 [details] [review]
342819-remove-file-icon-when-renamed-to-hidden-file.patch

The file was not added to old_changed_files list because it failed fm_directory_view_should_show_file check.
Comment 4 Cosimo Cecchi 2008-04-18 08:21:06 UTC
Pawel, thanks for the patch. However, I tested and it seem to behave in a unwanted way. We don't want the files renamed from "foo" to ".foo" to immediately disappear, as it's confusing to the user, but we want to keep showing them until we refresh the view.
Comment 5 Paweł Paprota 2008-04-18 08:27:01 UTC
Oh, I thought it was desirable behavior. I'll come up with other solution then. Thanks for the review.
Comment 6 Paweł Paprota 2008-04-20 19:44:18 UTC
Created attachment 109596 [details] [review]
342819-show-file-icon-when-renamed-to-hidden-file-until-refresh.patch

This one sure looks like a hack but I haven't found other solution for now without doing many changes. Thing is, signal handlers for file_changed and remove_file for different directory views are behaving inconsistently, eg. the one for file_changed in the icon view sometimes decides to remove an icon..

Let me know what do you think about this patch.
Comment 7 Cosimo Cecchi 2012-09-13 19:05:18 UTC
*** Bug 607680 has been marked as a duplicate of this bug. ***
Comment 8 Javier Kohen 2012-09-13 19:09:37 UTC
What would be the expected behavior? How about leaving the file in the icon view, but show its new name instead of the old one?
Comment 9 Cosimo Cecchi 2012-09-13 19:13:03 UTC
That's how I would expect it to work (and how it works in List view as far as I can see)...the file should be kept in view with the dotted name until the next refresh.
Comment 10 Nelson Benitez 2013-09-08 16:16:34 UTC
*** Bug 706255 has been marked as a duplicate of this bug. ***
Comment 11 Nelson Benitez 2013-09-08 16:24:56 UTC
Created attachment 254420 [details] [review]
Fix for the issue

This fix works fine for me.

Implements cosimo's desired behaviour as he told in comment 4 , which I also agree with, in fact I made this patch from the duplicated bug without knowing of cosimo's opinion in this bug.

It updates nautilus view "show file" logic to accept a hidden file (despite
show_hidden_files option set to false) if the hidden file is already visible in
the view (and we use the current file selection to check for that, as it
happens all rename usecases maintain the file selected).
Comment 12 Sebastien Bacher 2014-03-17 08:49:25 UTC
Seems it's still an issue in nautilus 3.10, could somebody review the patch here?
Comment 13 Nelson Benitez 2014-03-31 00:08:36 UTC
*** Bug 725461 has been marked as a duplicate of this bug. ***
Comment 14 André Klapper 2015-01-17 02:28:40 UTC
Comment on attachment 109596 [details] [review]
342819-show-file-icon-when-renamed-to-hidden-file-until-refresh.patch

src/file-manager/fm-directory-view.c does not exist anymore in git master.

Hence setting 'needs-rework' as patch does not apply cleanly against git master.
Comment 15 Alexandre Franke 2015-06-15 22:46:46 UTC
*** Bug 389812 has been marked as a duplicate of this bug. ***
Comment 16 Alexandre Franke 2015-06-15 22:56:57 UTC
The original issue has been fixed in current git master with the new renaming dialog. However, renaming a file to a hidden file name results in the file being still visible (with a hidden file name).

1. select foo
2. rename foo to .foo
3. .foo is the new name, the file is visible even if hidden files shouldn't be shown.
Comment 17 Carlos Soriano 2015-09-01 14:05:05 UTC
releasing blocking state since current state is acceptable.
Comment 18 Carlos Soriano 2016-03-02 18:08:38 UTC
Review of attachment 254420 [details] [review]:

Nelson, thanks for the patch!

However this implementation remove the file when is no longer selected. I would rather make it disappear instantaneously or wait until refresh.
I'm going to push a patch that removes it right away, since it's at least better than no changing the name at all.
I mark this one as need works.
Comment 19 Carlos Soriano 2016-03-02 18:11:50 UTC
Created attachment 322897 [details] [review]
files-view: hide hidden files when renamed

We were not renaming the file at all when the user changed the
file name to a dot file i.e. .whatever.

This was confusing. A better solution would be to show the new
file name until the user changes the directory, but I'm not sure
how much better is it versus hidding the file straig away, since
it can be even more confusing trying to hide your file and nautilus
not hiding it straig away.

For now hide instantaneously a file when renamed to a hidden file.
Comment 20 Carlos Soriano 2016-03-02 18:13:20 UTC
Attachment 322897 [details] pushed as 618f6a6 - files-view: hide hidden files when renamed