GNOME Bugzilla – Bug 342819
Renaming "file" to ".file" doesn't update the label
Last modified: 2016-03-02 18:13:25 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:
Confirming.
Still there, but in 2.21.2 this only happens in Spatial mode and on the Desktop.
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.
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.
Oh, I thought it was desirable behavior. I'll come up with other solution then. Thanks for the review.
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.
*** Bug 607680 has been marked as a duplicate of this bug. ***
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?
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.
*** Bug 706255 has been marked as a duplicate of this bug. ***
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).
Seems it's still an issue in nautilus 3.10, could somebody review the patch here?
*** Bug 725461 has been marked as a duplicate of this bug. ***
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.
*** Bug 389812 has been marked as a duplicate of this bug. ***
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.
releasing blocking state since current state is acceptable.
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.
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.
Attachment 322897 [details] pushed as 618f6a6 - files-view: hide hidden files when renamed