<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>121806</bug_id>
          
          <creation_ts>2006-02-12 01:17:52 +0000</creation_ts>
          <short_desc>special characters in file names reported by slocate are not converted to valid urls</short_desc>
          <delta_ts>2006-11-25 23:04:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kfind</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Georg Hennig">georg298</reporter>
          <assigned_to name="Eric Coquelle">coquelle</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>413435</commentid>
    <comment_count>0</comment_count>
    <who name="Georg Hennig">georg298</who>
    <bug_when>2006-02-12 01:17:52 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
OS:                Linux

Problem:
- have a file name containing a special character like &quot;#&quot; or even worse &quot;/&quot;
- have it in your current slocate db (updatedb)
- search the directory with kfind where the file is inside using the file index (slocate)
- the kfind result contains this file with invalid url

Example:
&quot;test#%20asdf&quot; is reported as &quot;test&quot; with 0 bytes file size and 0 modification time (=1.1.1970).

This comes from incorrect usage of KURL in kquery.cpp
KURLs are created directly from the slocate search result (which shows the special characters, e.g. &quot;#&quot;).
For example KURL( &quot;/path/to/test#asdf&quot; ) is an invalid url.
It should rather be KURL::fromPathOrURL( &quot;/path/to/test#asdf&quot; ).

Quotation from KURL reference:

KURL KURL::fromPathOrURL ( const QString &amp; text )[static]

Creates a KURL object from a QString representing either an absolute path or a real URL.

Use this method instead of

 QString someDir = ...
 KURL url = someDir;

Otherwise some characters (e.g. the &apos;#&apos;) won&apos;t be encoded properly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>413436</commentid>
    <comment_count>1</comment_count>
      <attachid>14648</attachid>
    <who name="Georg Hennig">georg298</who>
    <bug_when>2006-02-12 01:19:10 +0000</bug_when>
    <thetext>Created attachment 14648
fixes the bug for kde 3.5.1

the problem doesn&apos;t seem to be solved on current svn.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489674</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Koller">martin</who>
    <bug_when>2006-11-25 23:04:34 +0000</bug_when>
    <thetext>SVN commit 607835 by mkoller:

BUG: 121806

fix KURL usage with filenames including special chars
Patch provided by Georg Hennig


 M  +1 -1      kquery.cpp  


--- branches/KDE/3.5/kdebase/kfind/kquery.cpp #607834:607835
@@ -153,7 +153,7 @@
 
   for (; it != end; ++it)
   {
-    file = new KFileItem( KFileItem::Unknown,  KFileItem::Unknown, KURL(*it));
+    file = new KFileItem( KFileItem::Unknown,  KFileItem::Unknown, KURL::fromPathOrURL(*it));
     processQuery(file);
     delete file;
   }
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>14648</attachid>
            <date>2006-02-12 01:19:10 +0000</date>
            <delta_ts>2006-02-12 01:19:10 +0000</delta_ts>
            <desc>fixes the bug for kde 3.5.1</desc>
            <filename>slocate_special_characters.patch</filename>
            <type>text/plain</type>
            <size>442</size>
            <attacher name="Georg Hennig">georg298</attacher>
            
              <data encoding="base64">ZGlmZiAtdXIga2ZpbmRfb2xkL2txdWVyeS5jcHAga2ZpbmQva3F1ZXJ5LmNwcAotLS0ga2ZpbmRf
b2xkL2txdWVyeS5jcHAJMjAwNi0wMi0xMiAwMDozMzo0NS4wMDAwMDAwMDAgKzAxMDAKKysrIGtm
aW5kL2txdWVyeS5jcHAJMjAwNi0wMi0xMiAwMDo0NTo0Ni4wMDAwMDAwMDAgKzAxMDAKQEAgLTE1
Miw3ICsxNTIsNyBAQAogCiAgIGZvciAoOyBpdCAhPSBlbmQ7ICsraXQpCiAgIHsKLSAgICBmaWxl
ID0gbmV3IEtGaWxlSXRlbSggS0ZpbGVJdGVtOjpVbmtub3duLCAgS0ZpbGVJdGVtOjpVbmtub3du
LCBLVVJMKCppdCkpOworICAgIGZpbGUgPSBuZXcgS0ZpbGVJdGVtKCBLRmlsZUl0ZW06OlVua25v
d24sICBLRmlsZUl0ZW06OlVua25vd24sIEtVUkw6OmZyb21QYXRoT3JVUkwoKml0KSk7CiAgICAg
cHJvY2Vzc1F1ZXJ5KGZpbGUpOwogICAgIGRlbGV0ZSBmaWxlOwogICB9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>