Thiago Macieira thiago at
Tue Nov 14 01:00:17 GMT 2006

Alexander Neundorf wrote:
>int main()
>   KURL url("\nphp");
>   QString pretty=url.prettyURL();
>   QString filename=url.fileName();
>   cout<<"pretty: -"<<pretty.latin1()<<"- name: -"<<filename.latin1

This line is wrong:
>   KURL url2(filename);

This is KDE 3 code. You have to use KURL::fromPathOrURL().

>   QString pretty2(url2.prettyURL());
>   cout<<"pretty2: -"<<pretty2.latin1()<<"-"<<endl;
>   return 0;
>~/src/tests/kde3kurl$ ./hello
>pretty: - name: -main.
>pretty2: -main.
>So it seems prettyURL()/lazy_encode() doesn't handle the newline. Or

I'd say your first test pretty much showed that prettyURL() handles the 
newline. See the %0A in the first line of your debug output.

> maybe it's just that KURL::bMalFormed is true, since just the filename
> is probably no valid URL, is it ?
>So, do I really have to do something like
>url.prettyURL().mid(url.prettyURL().findRev('/')); or something like
> this ?

Huh? I didn't get this part.
  Thiago Macieira  -  thiago (AT) - thiago (AT)
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list