(*** This bug was imported into bugs.kde.org ***) Package: kfind Version: KDE 3.0.2 Severity: normal Installed from: Mandrake RPMs Compiler: gcc 2.96 OS: Linux OS/Compiler notes: Not Specified When I search for files in KFind and files whose name include spaces are included in the results: Saving search results as a HTML page produce wrong page (filename stripped after first space...). To reproduce: - get some files with spaces in their name - do a search that finds those files - save results as a HTML page - view that page... --- Tomas (Submitted via bugs.kde.org)
If someone fixes it, please also remove the <!DOCTYPE %1>, which should be replaced by a "generated by kfind" comment.
Fixed in HEAD. Diff: Index: kfwin.cpp =================================================================== RCS file: /home/kde/kdebase/kfind/kfwin.cpp,v retrieving revision 1.66 diff -u -p -r1.66 kfwin.cpp --- kfwin.cpp 10 Sep 2002 09:51:20 -0000 1.66 +++ kfwin.cpp 2 Mar 2003 19:13:24 -0000 @@ -228,7 +228,7 @@ void KfindWindow::saveResults() item = firstChild(); while(item != NULL) { - QString path=((KfFileLVI*)item)->fileitem.url().url(); + QString path=((KfFileLVI*)item)->fileitem.url().prettyURL(); QString pretty=((KfFileLVI*)item)->fileitem.url().prettyURL(); stream << QString::fromLatin1("<DT><A HREF=\"%1\">%2</A>\n") .arg(path).arg(pretty); @@ -241,7 +241,7 @@ void KfindWindow::saveResults() item = firstChild(); while(item != NULL) { - QString path=((KfFileLVI*)item)->fileitem.url().url(); + QString path=((KfFileLVI*)item)->fileitem.url().prettyURL(); stream << path << endl; item = item->nextSibling(); }
Subject: Re: kdebase/kfind On Monday 03 March 2003 13:23, Dominik Seichter wrote: > CVS commit by domseichter: > > fix for bug 46320: filenames containing spaces are saved correctly into the > html output file. This fix looks rather wrong to me. Why do you think that you have to use prettyURL() here? Cheers, Waldo
Subject: Re: kdebase/kfind Am Montag, 3. März 2003 13:32 schrieb Waldo Bastian: > On Monday 03 March 2003 13:23, Dominik Seichter wrote: > > CVS commit by domseichter: > > > > fix for bug 46320: filenames containing spaces are saved correctly into > > the html output file. > > This fix looks rather wrong to me. Why do you think that you have to use > prettyURL() here? Well, because it works for me. I can't give a better reason though. I asked an core-devel yesterday and no one complained, so I thought it is save to commit :-). If this fix makes things worse, I can revert it of course. CU Dom
A fixed patch was commited to HEAD and Branch. prettyURL() was removed from my patch, because it was _really_ wrong. The problem was that a space is encoded as "%20" and the following code was used to write the link to the file. You will see that we there are two %2 in the line now, if a file containing a space is written. stream << QString::fromLatin1("<DT><A HREF=\"%1\">%2</A>\n") .arg(path).arg(pretty);