[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: again ioslaves: how to append a "/" after the host ? (like the ftp-ioslave)
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-06-23 18:36:10
[Download RAW message or body]

On Fri, Jun 23, 2000 at 06:06:09PM +0200, aleXXX wrote:
> On Fri, 23 Jun 2000, David Faure wrote:
> >On Fri, Jun 23, 2000 at 05:20:02PM +0200, aleXXX wrote:
> >> If I enter "ftp://some_host" in konqy, the url changes to "ftp://some_host/",
> >> i.e. a trailing slash is appended. How and where is this done ?
> >
> >That's a tricky one. It's a redirection.
> >When opening a connection to a host, kio_ftp asks for the current dir
> >(it's not always '/', especially with non-anonymous ftp).
> >Then, in listDir, if no path was given, this means: use the default
> >path, i.e. redirect to that path that was found when opening
> >the connection. listDir emits a redirection, and this updates the location
> >bar (and a few KURLs along the way :-)
> 
> Puhh.
> In the smb ioslave it works a bit different, I can enter "smb://some_host", and
> if I go into the directory "some_share" a slash is inserted between the two
> parts. Do you know if this is simpler ? 

No, you need to emit a redirection, otherwise you'll end up with
smb://some_hostsome_share (I guess that's what you get currently).
But you case is a lot more simpler than kio_ftp's.
Just do, in listDir

 if ( path.isEmpty() )
 {
    url.setPath("/");
    emit redirection( url );
 }

> >It's KDirLister that detects the redirection, in case you want to debug it.
> >
> >How did the %2F trick go ?
> 
> Hmm, yes, looks a bit strange and not really finished yet, but kinda works.
> Do you have a better idea ?

Well, I think you should decide between the following two options.
* Either that /dir/subdir/ is only the name of the item when viewing the
share from the toplevel dir, but when you enter it you get to nfs://host/something/
where something doesn't contain slashes (you can do that using the UDS_URL field)

* or you want that /dir/subdir/ the real name of that dir, including when entering
it, but in this case you need to encode it. You can't have /dir/subdir/ in the
name AND have 'up' go to /. I don't see how that would be possible - unless
by hacking KURL :(

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic