A few thoughts about KUrl

Jarosław Staniek js at iidea.pl
Thu Dec 21 17:25:52 GMT 2006


Thiago Macieira said the following, On 2006-12-21 16:59:
> Jarosław Staniek wrote:
> 
>>>kurl.setPath("c:/") will be interpreted as kurl.setPath("/c:/") ? [no
>>>in QUrl]
>>
>>How about using "%3A" instead of ':' ?
> 
> 
> I don't think this is a good idea. Colons in pathnames are acceptable. But 
> using %3A in a URL is equivalent to ':', so you'd just confuse other 
> code.
> 
> Not to mention that it would break QUrl::toLocalFile().
> 
> 
>>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.
> 
> 
> Separator?

An URL separator for protocol/user/port e.g. as mentioned in 
QUrl::setUserInfo() documentation.

>>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?
> 
> 
> Do you mean KUrl("file:///C:/foo/bar").cd("/") -> "file:///C:/" ?

See my recent answer to Leonardo.

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi-project.org, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org





More information about the kde-core-devel mailing list