kio and scheme://

David Faure faure at kde.org
Tue Nov 4 20:49:03 UTC 2014


On Sunday 02 November 2014 23:23:55 Milian Wolff wrote:
> On Sunday 02 November 2014 13:43:50 Àlex Fiestas wrote:
> > Hi there
> > 
> > There are quite a few places where the following code is found:
> > 
> > if (!url.path().endsWith('/')) {
> > 
> >     url.setPath(url.path() + '/');
> > 
> > }
> 
> Unrelated to the below, this will also add a trailing slash to non-empty
> paths, preventing files from getting opened.

This is why we only do this for directories :

> > Given an url like: 'scheme://' KUrl will return '/' as path while QUrl
> > returns empty string.
> > 
> > This is making kio add a third slash to the url in many places (because of
> > code like the one pasted before).
> > 
> > As a result if you open dolphin and type smb://, it will be redirected to
> > smb:///.
> 
> Which is correct, no? An URL protocol is separated by ://. That's also why
> you need to type file:///tmp/bla/blub or the like. Missing a slash at the
> beginning will fail in all browsers I tested.

Yes but smb:/// means "a path of /" which is nonsense.
smb:// is supposed to show you a list of servers to choose from. Too early to 
even choose a path...

> What does "http://" mean?

Nothing, because http has no support for an empty host name. But smb does.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list