[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: branches/KDE/3.5/kdelibs/kio/kio
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2006-11-14 0:14:28
Message-ID: 200611140114.29424.neundorf () kde ! org
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic