Qt 4.8 QUrl.toLocalFile behavior change, impacts to KUrl (and friends)

Albert Astals Cid aacid at kde.org
Fri Oct 28 13:22:02 BST 2011


A Divendres, 28 d'octubre de 2011, Thiago Macieira vàreu escriure:
> On Friday, 28 de October de 2011 10:41:36 Sebastian Trüg wrote:
> > > So, to be honest, the bug already existed in your code if you're
> > > finding these problems now. I just made it blatantly clear, and
> > > it's been there for a  year for people to see.
> > > 
> > > 
> > > 
> > > I'm also calling right now KUrl's fromPathOrUrl a fatally flawed
> > > design.> 
> > Be that as it may but the fact remains that KDE potentially does not
> > work with Qt 4.8. Is that really a risk worth taking? I am all for fixed
> > semantics in the methods but this seems like a problematic case.
> 
> Let me repeat: the problem already existed. This just made the broken code
> more evident. You should fix it ANYWAY.

Right, it was wrong if it had to accept user input but for internal hardcoded 
paths, it worked and now it does not.

Albert

> 
> If you had a file path of:
> 	"/tmp/Who let the dogs out?.mp3"
> or	"/tmp/Mambo #5.mp3"
> 
> In Qt 4.7, toLocalFile on those URLs above would return:
> 
> 	"/tmp/Who let the dogs out"
> and	"/tmp/Mambo "
> 
> Which is quite wrong already. From Qt 4.8 on, this returns empty in all
> cases, showing that you parsed the URL wrongly. It should be easier to spot
> where you made the mistake because you don't have to use specially-crafted
> filenames.
> 
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>    Software Architect - Intel Open Source Technology Center
>       PGP/GPG: 0x6EF45358; fingerprint:
>       E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358




More information about the kde-core-devel mailing list