Issues with `nautilus_directory_is_not_empty`
The following discussion from !1315 (merged) should be addressed:
-
@antoniof started a discussion: (+2 comments) There was a good reason for this. We can assert that a directory is not empty, but we cannot assert it's empty, based solely on the file list. Even if the directory is monitored!
Reasons why a
NautilusDirectory
with an empty file list may not be really empty:- The file list has not yet been populated by the directory monitor (which happens async).
- The directory monitor is ignoring hidden files.
On the contrary, if the file list is not empty, and the directory is monitored, then it's safe to say the directory is not empty.
-
@p3732 responde I see, that does make sense. Two things though:
- Then the doc comment is incorrect
- The negated usage of this function runs into the same issue this commit has, essentially checking for an empty file list.
Maybe the expander should be set via a callback? That might get expensive though...