KUrl api docs wrong, or bug in the code?

Andreas Pakulat apaku at gmx.de
Wed Aug 20 12:55:07 BST 2008


On 18.08.08 18:50:18, Michael Pyne wrote:
> On Monday 18 August 2008, Andreas Pakulat wrote:
> > Hi,
> >
> > the api docs of KUrl say that one can feed the result of
> > KUrl::pathOrUrl() back into the KUrl constructor. But as far as I can
> > see this is not true. The constructor expects a remote url to be in
> > percent-encoding, i.e. no non-ascii characters in path or fragment.
> > While pathOrUrl uses prettyUrl which in turn produces unicode characters
> > instead of percent-encoding in path and fragment.
> >
> > I'm wondering now wether the api dox need to be changed to tell users to
> > use QUrl::setUrl() when reconstructing a url from the result of
> > pathOrUrl() or wether the code needs to be changed.
> 
> I would say that the docs are pretty clear.  Do we have a testcase on this 
> particular topic (feeding pathOrUrl() back to KUrl's ctor?)

We didn't have tests doing that, but I just added them. And it turns out
that I must have misread the  code or not read enough. At least the
tests I added succeed, which means the encoded version of a url created
from pathOrUrl is the same as the encoded version of the original url.

Andreas

-- 
You're not my type.  For that matter, you're not even my species!!!




More information about the kde-core-devel mailing list