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 340495 - Nautilus list view calls non-empty folders "empty" while they load
Nautilus list view calls non-empty folders "empty" while they load
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: List View
2.14.x
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-03 07:47 UTC by sam tygier
Modified: 2007-02-05 15:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Bugfix (3.53 KB, patch)
2007-02-04 12:46 UTC, Christof Krüger
none Details | Review
revised bugfix (3.90 KB, patch)
2007-02-04 14:17 UTC, Christof Krüger
none Details | Review
bugfix revision#2 (5.39 KB, patch)
2007-02-05 12:42 UTC, Christof Krüger
none Details | Review
bugfix revision #3 (5.52 KB, patch)
2007-02-05 12:50 UTC, Christof Krüger
none Details | Review

Description sam tygier 2006-05-03 07:47:56 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
Comment 1 Christof Krüger 2006-09-29 02:27:29 UTC
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).
Comment 2 Marcus Sundman 2007-02-03 00:12:36 UTC
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.
Comment 3 Christof Krüger 2007-02-04 12:46:51 UTC
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.
Comment 4 Christof Krüger 2007-02-04 14:17:52 UTC
Created attachment 81874 [details] [review]
revised bugfix

There was a minor bug in the bugfix.
Comment 5 Alexander Larsson 2007-02-05 10:13:06 UTC
See mailinglist for review.
Comment 6 Christof Krüger 2007-02-05 12:42:55 UTC
Created attachment 81924 [details] [review]
bugfix revision#2
Comment 7 Christof Krüger 2007-02-05 12:50:53 UTC
Created attachment 81926 [details] [review]
bugfix revision #3

sorry for the bugspam. the patch was missing one line.
Comment 8 Alexander Larsson 2007-02-05 15:55:58 UTC
A patch based on this checked in.