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

List:       kde-core-devel
Subject:    KURL encoding question
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-03-11 11:44:16
[Download RAW message or body]

kdelibs/kio paste.cpp,1.22,1.23
Author: faure
CVSROOT: /home/kde
Sat Mar 11 02:39:53 MET 2000
Update of /home/kde/kdelibs/kio
In directory zeus:/tmp/cvs-serv4636

Modified Files:
	paste.cpp 
Log Message:
Squashed one more decodeToUnicodeUris - as its doc says, this one is wrong.

The right thing to do is to use QUriDrag::decode and then
KURL(QString::fromLatin1(*it)) on each item (if you use KURL).

Looks hacky, but since URLs _are_ encoded, they are ascii (hmm, there is
no fromAscii() so I use fromLatin1), so this is fine.

To be fixed: khexedit, kcmkdm, kpresenter, pixie... and Qt examples :)
I will fix those tomorrow unless anybody does it before me.

----- End forwarded message -----

If this is right ... shouldn't KURL accept a constructor from a QCString 
instead of a QString ?
The string being already encoded, it should only contain ascii characters
(abcd...0..9..%2f%2e etc.) so it should be fine with a QCString...
But we store encoded URLs as QStrings in a lot of places. Well, it works
too, but a .ascii() would be needed in those places in case the old
constructor is dropped - or turned into a constructor for local paths
only ( /dir/sub dir/ -> file:/dir/sub%20dir/ )

Opinions ?

Dawit, I know you have plans for KURL. However I'd prefer to do a step-by-step
migration towards the "right thing" rather than a "break-it-all" migration...
KURL is very critical in KDE...

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/
KDE, Making The Future of Computing Available Today

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

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