A few thoughts about KUrl

Stephen Leaf smileaf at smileaf.org
Thu Dec 21 21:58:52 GMT 2006


On Thursday 21 December 2006 8:16 am, Leonardo Stern wrote:
On a side note doesn't windows use \ for its separators not / ?
C:\Directory\example ?

> Just trying to understand the desired behavior (not to current one)  of
> kurl ..
>
> Given:
>
> KUrl kurl("file:///c:/");
>
> there are 2 suggested behaviors for kurl.path() and kurl.toLocalFile() :
>
> ===Case 1 - as seen in QUrl ===
> kurl.path() => "/c:/"
> kurl.toLocalFile() => "c:/"
>
> Some questions :
> kurl.isRelative() ? [no in QUrl]
> QDir(kurl.path()).isRoot ? [yes in QUrl]
> kurl.setPath("/") creates a valid URL ?  [yes in QUrl]; What should be
> kurl.toLocalFile() on Windows ? ["/" in QUrl]
> kurl.setPath("c:/") will be interpreted as kurl.setPath("/c:/") ? [no in
> QUrl]
>
> ===Case 2 - as seen in Linux (file == path) ===
> kurl.path() => "c:/"
> kurl.toLocalFile() => "c:/"
>
> Some questions:
> kurl.isRelative() ?
> QDir(kurl.path()).isRoot ?
> kurl.setPath("/") creates a valid URL ? What should be
> kurl.toLocalFile() on Windows ?
> kurl.setPath("/c:/") will be interpreted as kurl.setPath("c:/") ?
> ===
> Should KUrl("/") act as a relative path on windows ? (
> KUrl("file:///C:/foo/bar") + KUrl("/") = KUrl("file:///C:/") , similar
> to "cd /" in windows console)
>
> regards,
> Leonardo Stern

-- 
Stephen Leaf




More information about the kde-core-devel mailing list