Re: [patch] don't show "(Empty)" in list view when dir not empty



On Sun, 2007-02-04 at 16:36 +0100, Christof wrote:
> Hi,
> I've written a patch to
> http://bugzilla.gnome.org/show_bug.cgi?id=340495
> Could someone please take a look at it? It's the first time I was
> looking on nautilus code, so I'm not sure if the patch is okay.

I think your analysis is right, but the fix isn't. Once you've gotten a
single add_files you set has_children, and then the directory will seem
to have children forever, even if they are later removed.

Also, the timeout we're doing in fm_list_model_subdirectory_done_loading
and its handling of ->loaded seems to be a not-quite-working attempt to
solve this bug. We should just make sure it works.

What about this solution:
Add a files_added handler like you did.
In fm_list_model_subdirectory_done_loading, if files_added hasn't been
called, set loaded = TRUE immediately and send out the change so that
the view changes. If files_added has been called, don't do anything, as
we know a file will eventually be added. Then, in
fm_list_model_add_file, we set loaded = TRUE (no need to signal a change
though, becase we will anyway when we add the file. (However loaded will
be set if we later remove all files.)

Can you try that instead?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a shy dishevelled matador whom everyone believes is mad. She's a 
mistrustful Buddhist college professor with an incredible destiny. They fight 
crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]