KUrl::path() <-> KUrl::toLocalFile()

Thiago Macieira thiago at kde.org
Tue Feb 24 20:27:12 GMT 2009


Christian Ehrlicher wrote:
>Hi,
>
>While on Linux QUrl::path() == QUrl::toLocalFile(), this is not true for
>windows. To work around this, a wrong hack was added to KUrl::path() to
>also return a local file.
>I removed this hack and have to change a lot of places from KUrl::path()
>to KUrl::toLocalFile(). Now my question is if there're some
>disadvantages in using KUrl::toLocalFile() which I've to remember.

toLocalFile() is the right thing, because it returns empty if the URL is 
not a local file. Using path() will lead to subtle mistakes like:

	http://localhost/index.html 		->	 /index.html

toLocalFile() also creates UNC pathnames, which path() won't do.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090224/1a789fdd/attachment.sig>


More information about the kde-core-devel mailing list