KURL being evil?

Simon Hausmann hausmann at kde.org
Fri Jan 16 14:51:28 GMT 2004


On Friday 16 January 2004 15:42, Charles Samuels wrote:
> Why is it that KURL::url() cannot be undone?  Or rather said, how do I
> stringify a URL?
>
> allow me to demonstrate:
>
> KURL url;
> url.setPath("/home/charles/foo%20moo");
> // there is a file name /home/charles/foo%20moo -- the documentation says
> that // setPath() (and path()) operate on decoded values
>
> QString path = url.url();
> path == "file:/home/charles/foo%20moo"; // this is correct for the same
> reason
>
> KURL(path).path() == "file:/home/charles/foo moo";
>
> Is there a function I haven't noticed, is this a bug, or is there a
> function that's missing?

I think KURL::fromPathOrURL(path).path() == path holds. Is that what you're 
looking for?

Simon




More information about the kde-core-devel mailing list