[Qt-interest] anyone know why QDir::mkpath() isn't static?

Thiago Macieira thiago at kde.org
Fri Apr 15 16:36:55 CEST 2011


On Thursday, 14 de April de 2011 11:53:53 Alan Ezust wrote:
> I can't use QUrl::toLocalFile() because it truncates paths that
> contain # and other weird characters.

You can use QUrl::toLocalFile. If you think it's truncating, then your problem 
is elsewhere. It does not truncate anything for valid URLs.

E.g., for a file called:

	/tmp/Mambo #5 or not?.txt

The proper URL is:

	file:///tmp/Mambo %235 or not%3f.txt

(and I'm being lax by not encoding the spaces as %20)

If you think QUrl is truncating, you're probably misusing the QUrl constructor 
and passing it a file name instead of a URL. Use QUrl::fromLocalFile if you 
have a file name.

-- 
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: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110415/f1dc6c0a/attachment.bin 


More information about the Qt-interest-old mailing list