GNOME Bugzilla – Bug 46200
Trash properties window doesn't show size if viewed before others
Last modified: 2008-02-25 15:47:26 UTC
To reproduce: (1) Launch Nautilus (2) Right-click trash icon on desktop and choose "Show Properties" Note that by "Contents" it says "--" If you insert (1.5) Right-click any normal folder and choose "Show Properties", then step (2) works properly. I think the async machinery in NautilusDirectory isn't getting kicked off properly in the trash case. ------- Additional Comments From don@eazel.com 2001-02-14 17:04:43 ---- Lowering to P5. ------- Additional Comments From darin@bentspoon.com 2001-02-27 10:50:55 ---- Lets reconsider how important it is to fix this minor bug. ------- Additional Comments From don@eazel.com 2001-02-27 15:03:58 ---- Hmmmm, does that mean you want to fix it for you don't want to fix it? ------- Additional Comments From darin@bentspoon.com 2001-02-27 15:13:17 ---- It means I'd like to not fix it. ------- Additional Comments From don@eazel.com 2001-02-27 15:36:37 ---- OK, off to 1.2 it goes. ------- Additional Comments From eli@eazel.com 2001-03-05 17:51:18 ---- Doh. I nearly just filed this. (Now, the Contents field is displayed as "...", rather than "--".) ------- Additional Comments From eli@eazel.com 2001-03-26 11:19:40 ---- SPAAAAAAAAAM! (Jon Allen has taken these components; QA Assigning bugs to him.) ------- Bug moved to this database by unknown@bugzilla.gnome.org 2001-09-09 20:57 -------
Changing to "old" target milestone for all bugs laying around with no milestone set.
Moving to 1.1.x - Though this may be a different bug, the Trash now *never* shows its size in the properties dialog. I'll leave priority and severity to Louie - this is no huge deal.
Would be nice but yeah, not huge.
I was tempted to fill this bug a lot of times. Let's see how much space can I save emptying the trash... ops, nautilus does not shows the size for the trash?? "..." <--- Does this mean working? How much must I wait before realizing nautilus won't show the real size? Please fix the bug or remove the "Contents" label for the trash properties dialog, now it looks *broken* and confusing.
This bug is still there in 2.2.3.1.
bug still in 2.3.3
Bug still present in 2.9. I have to show the properties window of Trash and the Home icon on the desktop twice before I get to see the size. Furthermore the for Trash it never shows the Volume and the Free Space. If I open ~/.Trash it shows the size right away. I've been trying to see what's but I don't understand it yet. nautilus_trash_file is a subclass of nautilus_file. The method which needs to get the file size is get_deep_counts. What happens is that when you select Trash 1) nautilus_file_get_deep_counts first gets called by file pointing to "Trash" 2) nautilus_trash_file_get_deep_counts with file pointing to "Trash" 3) nautilus_file_get_deep_counts get called with file pointing to ".Trash" This seems reasonable but somehow the total size and number of files do not get returned. If you select ~/.Trash what happens is that only nautilus_file_get_deep_counts get called with file pointed to ".Trash". So only number 3 of the previous case gets called but now it works.
Created attachment 37802 [details] [review] This solves it but probably not the ideal way. So comments appreciated The problem why the Trash folder and the home folder didn't show size and free space was because nautilus_file_recompute_deep_counts(file) was called with file pointing to x-nautilus-desktop:///trash for the trash folder and x-nautilus-desktop: for the home folder. Changing original_files to target_files solved the problem for the home dir. The trash dir still didn't work that's why I made a hack in get_target_file_for_original_file so that i.s.o. trash: just ~/.Trash get's passed into nautilus_file_recompute_deep_counts. Don't know if nautilus_file_recompute_deep_counts is supposed to work if you put the "trash:" URI in there. Sid effect of this patch is that location in the property window changes from On the desktop to your home directory. Don't know if this is bad because if you select a file in the trash it also says the location is in ~/.Trash
Jaap: don't know if you already did this or not, but the nautilus maintainers mostly ignore patches in bugzilla- please email it to nautilus-list for their review. Thanks...
I commited the original_files -> target_files part. However, the trash fix isn't right. We need to figure out why nautilus_file_recompute_deep_counts(file) doesn't work for trash://. It should work.
OK, I don't mind having a go for it, but I would need some explanation what is happening? Getting the file info is working asynchronously, but I haven't found which call is actually getting the file info stuff. I've put break points on the file_info calls in gnome_vfs but they don't get called. Should nautilus handle the translation for trash: or is this part of gnome-vfs?
Jaap: You're definitly doing the wrong thing here. "trash:" is not part of GnomeVFS, it is just a virtual location which bundles various other directories - inter alia ~/.Trash. From a quick look at FMPropertiesWindow, I'd say you'll have to append all directories you get through nautilus_trash_monitor_get_trash_directories to the list of target files if nautilus_desktop_link_get_link_type returns NAUTILUS_DESKTOP_LINK_TRASH for the encountered NautilusDesktopLink.
Christian, I knew that I didn't have the right solution. Spent quite some time on finding out why it didn't work and finally gave up on it :-(. Feel free to come up with a patch yourself. You seem to be really good at it :-) Please also post the patch here. So I can learn something
Created attachment 49897 [details] [review] Proposed libnautilus-private/ patch
Created attachment 49898 [details] [review] Proposed prelimitary src/ patch OK, this is the interesting part. We replace the desktop link by its associated URIs. This already works pretty well for the trash icon on desktop, but doesn't work for the self properties (the background context menu properties item) of trash:. We'd have to replace the "trash:" URIs in the property window presentation function by the desktop link. It could be a simple as adding a nautilus_file_get ("x-nautilus-desktop:///trash"), but it might be a bit more tricky if it does additional voodoo in the background - for instance I'm not sure whether x-nautilus-desktop:///trash exists if there is no trash on the desktop. Maybe we'll have to create our custom trash link in that case or something... .
Bah, these patches just suck.
Created attachment 49969 [details] [review] Proposed patch OK, I've sat down and tried to fix this issue with a sane approach. I think the way we used to handle this was also broken for remote trash directories that haven't been viewed before.
Just FYI, [1] and [2] have discussion on this patch [1] http://mail.gnome.org/archives/nautilus-list/2005-July/msg00330.html [2] http://mail.gnome.org/archives/nautilus-list/2005-August/msg00009.html
I'll work on this. See also the last comments in bug #171073.
Sorry, I totally dropped the ball on this. Was this the problem of the trash window not updating its status bar when a volume gets unmounted?
Still occurs with Nautilus 2.16.1 on Ubuntu Edgy.
To me this seems fixed in Nautilus 2.21.x (GIO). Can someone confirm it?
Can't reproduce this either, closing as OBSOLETE. Please feel free to reopen the bug is this still happens with Nautilus >= 2.21.x, thanks!