[Qt-interest] anyone know why QDir::mkpath() isn't static?
Alan Ezust
alan.ezust at gmail.com
Mon Apr 18 18:12:23 CEST 2011
On Fri, Apr 15, 2011 at 7:36 AM, Thiago Macieira <thiago at kde.org> wrote:
> 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.
I guess QUrl::toString() decode those escapes again, because I never actually
see the %235 in the urls I've created, using either technique.
But that must be what I was doing earlier to get this problem. thanks!
More information about the Qt-interest-old
mailing list