[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KUrl::path() <-> KUrl::toLocalFile()
From:       Thiago Macieira <thiago () kde ! org>
Date:       2009-02-24 20:27:12
Message-ID: 200902242127.22769.thiago () kde ! org
[Download RAW message or body]


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

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic