A few thoughts about KUrl

Leonardo Stern leonardo.stern at gmail.com
Thu Dec 21 15:16:32 CET 2006


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



More information about the Kde-windows mailing list