[Qt-interest] QDir failing to list non-ascii directories
Robin Hill
qt at robinhill.me.uk
Thu Nov 12 16:12:19 CET 2009
On Thu Nov 12, 2009 at 03:42:53PM +0100, Jochen Roemmler wrote:
> Hi Robin,
>
> I know, this may be off-topic, but just in case the code you sent is
> partly from MythTV project, I wanted to let you know that ...
>
> > tmp = QString("file::%1::%2").arg(p->fileName()).arg(p->size());
> ^^^^^^^
> ...this substitution will NOT do what you expect if the arguments
> contain format specifiers like "hello%1world.mpg" (this is a feature,
> not a bug). You'll have to build the string differently ...
>
Good point - I'll have a look into whether there's any sanitisation of
strings going on in there.
> > out << QString("%1").arg(tmp);
>
> Any reason why you're doing it so complicated?
>
> out << tmp << endl;
>
> or even better:
>
> qDebug() << tmp;
>
> should do, shouldn't it? (the latter requires #include <qdebug.h>)
>
That's just what I stuck in to read the code out. And yes, I had a
brain-fart and made it far more complicated than it needed to be!
Cheers,
Robin
--
___
( ' } | Robin Hill <qt at robinhill.me.uk> |
/ / ) | Little Jim says .... |
// !! | "He fallen in de water !!" |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091112/c7907f70/attachment.bin
More information about the Qt-interest-old
mailing list