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 555234 - Restore from trash is not working properly
Restore from trash is not working properly
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
0.x.x [obsolete]
Other All
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 557849 559487 561906 562369 562497 563830 569038 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-10-06 14:07 UTC by Giuseppe Fuggiano
Modified: 2009-01-28 15:56 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
a patch for this bug (698 bytes, patch)
2009-01-22 10:19 UTC, Mingxi Wu
needs-work Details | Review
use nautilus_file_invalidate_attributes (561 bytes, patch)
2009-01-28 15:39 UTC, Cosimo Cecchi
committed Details | Review

Description Giuseppe Fuggiano 2008-10-06 14:07:20 UTC
Please describe the problem:
After restored a file from the trash, right-clicking on the file restored, the "Restore" entry is still present.  Selecting this entry, the overwrite confirmation appears.


Steps to reproduce:
1. Restore a file from the Trash;
2. Right click on restored file;
3. The "Restore" entry is still present in the popup menu.



Actual results:
Restoring again, the overwrite confirmation appears.

Expected results:
The Restore entry should disappear or should appear only if in the Trash.

Does this happen every time?
Yes

Other information:
On the restored file icon is present a "lock" icon in the top-right corner.
Comment 1 Filippo Argiolas 2008-10-08 13:32:11 UTC
I have the issue here too, confirming the bug.
Note also that Restore action and lock icon disappear pressing F5 or restarting nautilus.
Comment 2 Cosimo Cecchi 2008-11-07 10:15:55 UTC
*** Bug 559487 has been marked as a duplicate of this bug. ***
Comment 3 Cosimo Cecchi 2008-11-10 20:08:51 UTC
This doesn't happen anymore in trunk, I guess this has been fixed by

2008-10-17  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-directory-async.c:
        * libnautilus-private/nautilus-directory-private.h:
        Add nautilus_directory_has_active_request_for_file which returns true
        if monitoring or call_when_ready the file or all the files in the directory.
        * libnautilus-private/nautilus-directory.c:
        (nautilus_directory_add_file):
        When adding a file to a directory, if there is an outstanding request
        for the file, add it to the work queue so we make sure to do i/o on it.
        Otherwise we could for instance block a call_when_ready with file=NULL
        because we're waiting for something to happen on all files in the dir
        but the newly added file never has any i/o happen to it.

Closing as FIXED.
Comment 4 Cosimo Cecchi 2008-11-10 20:09:23 UTC
*** Bug 557849 has been marked as a duplicate of this bug. ***
Comment 5 Michael Monreal 2008-11-17 10:27:38 UTC
I just built glib, gvfs, nautilus etc trunk yesterday and I still see this issue. Can anyone else confirm anything changed for them?
Comment 6 Cosimo Cecchi 2008-11-29 12:04:43 UTC
*** Bug 562369 has been marked as a duplicate of this bug. ***
Comment 7 Cosimo Cecchi 2008-11-29 12:05:25 UTC
Reopening for last comment, I will test this again with all the libs from trunk and see if I can reproduce.
Comment 8 Cosimo Cecchi 2008-11-29 12:06:30 UTC
*** Bug 562497 has been marked as a duplicate of this bug. ***
Comment 9 Cosimo Cecchi 2008-11-29 12:20:34 UTC
*** Bug 561906 has been marked as a duplicate of this bug. ***
Comment 10 Filippo Argiolas 2008-12-09 10:42:37 UTC
*** Bug 563830 has been marked as a duplicate of this bug. ***
Comment 11 Mingxi Wu 2009-01-22 10:19:46 UTC
Created attachment 126983 [details] [review]
a patch for this bug

More details can be found at https://bugzilla.novell.com/show_bug.cgi?id=456702
Comment 12 A. Walton 2009-01-22 13:54:40 UTC
Patch is pretty clearly unacceptable; doesn't follow coding style or conventions, not C89 (defines variable in the middle of the block), synchronous I/O is forbidden in most places in Nautilus, and we already have mechanisms in place that do precisely what you're getting at in the patch (namely nautilus_file_invalidate_attributes in this case).

I'm not 100% sure that this is the right place to invalidate the attributes either, but it's probably closer to the real problem than I've managed to locate. It doesn't seem that the code path from nautilus_file_operations_move() in fm-directory-view.c, through the update queue and to the nautilus directory code ever calls nautilus_file_invalidate_attributes() on the file /after/ the file has moved to the new location, which will trigger the update of the menus and the clearing of the bogus "lock" icon.
Comment 13 A. Walton 2009-01-25 05:25:45 UTC
*** Bug 569038 has been marked as a duplicate of this bug. ***
Comment 14 Cosimo Cecchi 2009-01-28 15:39:13 UTC
Created attachment 127400 [details] [review]
use nautilus_file_invalidate_attributes

This patch implements what is suggested in the last comment from awalton.
Comment 15 Cosimo Cecchi 2009-01-28 15:56:38 UTC
Committed to trunk.

2009-01-28  Cosimo Cecchi  <cosimoc@gnome.org>

	* libnautilus-private/nautilus-directory.c:
	(nautilus_directory_notify_files_moved):
	Invalidate file attributes after it has been moved, so that
	they are refreshed properly (#555234).