unexpected KUrl behavior: KUrl("someFile.ext").isLocalFile() == false

Thiago Macieira thiago at kde.org
Wed Jun 16 18:03:24 BST 2010


Em Quarta-feira 16 Junho 2010, às 18:02:50, Milian Wolff escreveu:
> Can someone elaborate on why this is the correct behavior? To me something
> like:
> 
> KUrl("someFile.txt").isLocalFile() should return true

That's a wrong assumption.

That URL is a relative URI with no scheme. It does not represent a local file 
-- those need to have scheme "file".

That URL can be turned into a local file by resolving it against the current 
directory (see QUrl::resolve). A URL of "file:" can be used to cause it to be a 
local file.

By the way, I was implementing the same functionality in QUrl, but had to pull 
it out of Qt 4.7 due to the number of places where that mistaken assumption 
appeared. I will reintroduce it with 4.8.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      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: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100616/256027c3/attachment.sig>


More information about the kde-core-devel mailing list