[PATCH] Multiple redirections and KDirListerCache

Hamish Rodda meddie at yoyo.its.monash.edu.au
Mon Sep 2 11:21:12 BST 2002


On Mon, 2 Sep 2002 07:31 pm, David Faure wrote:
> On Sunday 01 September 2002 09:18, Hamish Rodda wrote:
> > Ok, I have nailed the cause of bug #46849 - when redirecting,
> > KDirListerCache looks up URLs without removing trailing slashes, but it
> > remembers them by removing the trailing slashes.  The following pach
> > changes the lookup to also remove trailing slashes.
>
> Good catch!

Thanks, it took some doing :)

> Here's an equivalent, but slightly more efficient / consistent patch:

That's a nice thought, but on accessing webdav://okmaybe.com/ it causes the 
assert at line 440 (::forgetDirs()) to be triggered later on.  This seems to 
be because oldUrl is used later in the function and this makes other places 
picky.  In fact, url gets the same treatment as my patch (using .url(-1) to 
insert into the two lists at the end of slotRedirection).  For true 
consistency, both urls would need the .adjustPath(-1) treatment, and this is 
(I guess) likely to spill over to other areas of the class.  Should I commit 
as posted previously, or have someone more knowledgeable give it the 
once-over using .adjustPath(-1) as required?

> > Now, the next issue is that KDirListerCache does not check to see if the
> > redirection URL is actually a directory with stat(), resulting in "file
> > or directory not found" when a direction happens to a file rather than a
> > directory, as is the case at webdav://okmaybe.com/ - Is this behaviour
> > "wrong"?  It's such a corner case that it's pretty much academic,
> > however.
>
> Hmmmm.... why didn't a stat() happen in the first place (before starting to
> list the dir) ? If a stat() happens first, then the redirection can say
> "it's a file". After we start listing, it's too late.

I thought this strange too.  KFileDialog is the one requesting the list() 
without stat() - I guess this is because the request is only triggered by a 
URL with a trailing slash.  I don't know what to do with it really - during a 
list(), once a redirection is called, there isn't a stat() called anyway.

Cheers,

Hamish.




More information about the kfm-devel mailing list