A few thoughts about KUrl

Leonardo Stern leonardo.stern at gmail.com
Thu Dec 21 17:19:46 CET 2006


> How about using "%3A" instead of ':' ?
> Then we'd have no problem in places where ':' is considered as a separator.
> Assume nobody should win32-specific absolute paths ("c:/") in portable code.
>
> Let's see whether this could work...
>
>  > Should KUrl("/") act as a relative path on windows ? (
>  > KUrl("file:///C:/foo/bar") + KUrl("/") = KUrl("file:///C:/") , similar
>  > to "cd /" in windows console)
>
> Wouldn't using this side effect make the code unportable?

Not at all. In linux, we have only one root dir, in Windows, one for
each drive letter.
If "file:////" works on linux (did't check yet), must also works on Windows

1 - "file:///" can reffer to root of the current unit (drive letter)
[root in linux].

For portability : KUrl("file:///c:/foo/bar").cd("/") ==
KUrl("file:///") == KUrl("file://c:/")
In this case, "/" point to QDir::rootPath()  == "c:/"

2 - "file:///" can reffer to a virtual root that contains all drive
letters [root in linux] (as seen in Opera)

regards
Leonardo Stern



More information about the Kde-windows mailing list