branches/KDE/3.5/kdelibs/kio/kio

Alexander Neundorf neundorf at kde.org
Tue Nov 14 00:14:28 GMT 2006


Hi Dirk, 

thanks for looking at it.

On Monday 13 November 2006 14:35, you wrote:
> On Sunday 12 November 2006 02:41, Alexander Neundorf wrote:
> > fix #15876: if a file name contains a newline, the newline was displayed
> > in the status bar, which m
>
> This looks a bit like a wrong fix to me. it should use prettyURL() which
> should have fixed this issue already..

Hmm...

int main()
{
   KURL url("http://www.neundorf.net/main.\nphp");
   QString pretty=url.prettyURL();
   QString filename=url.fileName();
   cout<<"pretty: -"<<pretty.latin1()<<"- name: -"<<filename.latin1
()<<"-"<<endl;

   KURL url2(filename);
   QString pretty2(url2.prettyURL());
   cout<<"pretty2: -"<<pretty2.latin1()<<"-"<<endl;
   return 0;
}

produces:

~/src/tests/kde3kurl$ ./hello
pretty: -http://www.neundorf.net/main.%0Aphp- name: -main.
php-
pretty2: -main.
php-

So it seems prettyURL()/lazy_encode() doesn't handle the newline. Or 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 ?

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net




More information about the kde-core-devel mailing list