[PATCH] Multiple redirections and KDirListerCache

David Faure david at mandrakesoft.com
Mon Sep 2 11:39:22 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 02 September 2002 12:21, Hamish Rodda wrote:
> > 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.

Huh? All the urls within KDirLister are supposed to be normalized
to "no trailing slash". forgetDirs() does use url(-1) ... and I just checked
all the lines adding entries to urlsCurrentlyHeld[], they all use url(-1) too.

>  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
Right.

>, and this is 
> (I guess) likely to spill over to other areas of the class.

I'm starting to see the problem. It's not _in the class_ that the problems
are, but in the users of the class, i.e. the konq views. Those might not be
"no-trailing-slash" safe, and this might be the reason for the problems.

> Should I commit as posted previously

Feel free to do so, but this will still need to be investigated/cleaned up at some point....

> > > 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.

- From webdav.protocol:
 defaultMimetype=application/octet-stream
 determineMimetypeFromExtension=false
So the trailing slash leads KMimeType::findByURL to say "unknown", not "it's a dir".
So I don't think the trailing slash is the reason here.

>  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.

Sure. As I said, it's too late at that point.
In the file dialog, one can only see dir listings anyway, which is why it doesn't
stat() first. If there's a redirection to a file, kfiledialog says "I can't list it", which
is correct, no?

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KOffice-1.2-rc1 is out. ftp://ftp.kde.org/pub/kde/unstable/koffice-1.2-rc1/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9cz/a72KcVAmwbhARAuPjAKCvJpfe42iVDDxs9ufJv0MmTM1hoQCfSZGI
hPabhLiyGJFtLy3pg6Bs1LI=
=cagg
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list