GNOME Bugzilla – Bug 340495
Nautilus list view calls non-empty folders "empty" while they load
Last modified: 2007-02-05 15:55:58 UTC
Please describe the problem: Switching Nautilus to list view and clicking the arrow next to a folder to expand it, on a folder with quite a lot of contents, causes Nautilus to first display "Loading..." then "(empty)" underneath the folder before it finally displays the folder contents. Steps to reproduce: 1. set a folder to list view 2. click the triangles to folder open subfolders 3. the "loading" changes to "(empty)" for some folders before you see the contents Actual results: Expected results: Does this happen every time? on my machine i'd say this happens once in 5 times. it wount happen if you close and reopen the folder (presumably because the contents is cached) Other information: also reported at https://launchpad.net/distros/ubuntu/+source/nautilus/+bug/42690
I can confirm that. It happens on the right pane list view only. Please also read my experiences with this bug in the downstream bug report https://launchpad.net/distros/ubuntu/+source/nautilus/+bug/42690 It also happens with 2.16 (I'm on ubuntu edgy beta right now).
I've lost so much stuff because of this bug! I switch open a folder and it says "(empty)" so I Shift-Delete it (instead of normal Delete because the bad implementation of the trash-thingy make it so utterly useless) and I just catch a glimpse of my files appearing in the list a fraction of a second before they disappear to the great bit-bucket in the sky. This bug causes data loss so it priority should be very high! And don't say that people should wait and see if a folder will show files, because there is nothing indicating that it's still scanning (which is a problem even efter it starts showing files, one doesn't know when it has finished scanning the folder). And yeah, I should have backups. Still, because of this bug I just LOST the backup of one of my DVDs, and I needed it (the DVD was a very expensive instructional video)! I'm so mad right now that I could kill the moron who made nautilus say the folder is "empty" when it really contained very important files.
Created attachment 81865 [details] [review] Bugfix This bug is caused by the fact that actually adding files to the list model is delayed (queue_pending_files() in fm-directory-view.c). However, the done_loading-event is handled immediately. This means that the done_loading-event can arrive earlier than the files_added-event from the list model point of view. The problem is, that the done_loading-handler of the list model needs to check if there are no files in the directory. This is because the done_loading event is the last event the list model will receive for this directory for the time being. Therefore, this is the only chance to replace "Loading..." by "(Empty)" when the directory is empty. As mentioned above, it can happen, that there are files pending to be added yet, but unfortunately, the done_loading-handler has no clue about this. The attached patch fixes the issue by registering a handler for the files_added-event so that the list model is informed about pending file additions. The handler sets a newly introduced flag "has_children" in the corresponding FileEntry. This way the done_loading handler will set the text to "(Empty)" _only_ when there are no pending fil additions for the given directory. Please check the patch for bugs though. It's the first time I've ever worked with Nautilus code, so the patch could have undesired side effects.
Created attachment 81874 [details] [review] revised bugfix There was a minor bug in the bugfix.
See mailinglist for review.
Created attachment 81924 [details] [review] bugfix revision#2
Created attachment 81926 [details] [review] bugfix revision #3 sorry for the bugspam. the patch was missing one line.
A patch based on this checked in.