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



On Mon, 2007-02-05 at 13:43 +0100, Christof wrote:
> On Mo, 2007-02-05 at 11:05 +0100, Alexander Larsson wrote:
> > 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.
> Good point. I haven't thought of that. 
> 
> I've uploaded a reviewed patch to the bugtracker.
> http://bugzilla.gnome.org/show_bug.cgi?id=340495

I'll take a look.

> There's another point still left.
> Currently, the dummy entry is replaced by the first file entry added to
> the directory. Theoretically, on a device with high latency, it could
> happen that the first entry is retrieved quite fast, but some remaining
> entries may need some more time, maybe even seconds. The user doesn't
> have any visual feedback whether the loading of the directory already
> finished or not. For this reason it would be practical if the dummy
> entry saying "Loading..." would stay there as long as all pending files
> for that directory were handled.
>
> To achieve it without changing the current implementation too much, one
> could count the file additions in the new files_added handler and
> decrement this counter on each call to add_file. When the counter hits
> zero, remove the dummy entry.
> 
> Since I'm new to nautilus code, I've no idea if there would be any side
> effects and if it is guaruanteed if every queued file to be added will
> actually yield a call to add_file.
> 
> What do you think about it?

It sounds a bit dangerous. We'd be encoding knowledge of how some
details in the directory view handles file additions in the list model,
and those may change in the future (or have complications). Maybe we
could have a small timeout like we do now to avoid this in most cases.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an uncontrollable Republican ex-con plagued by the memory of his family's 
brutal murder. She's a ditzy Bolivian angel who dreams of becoming Elvis. They 
fight crime! 




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