From kde-devel Mon Jul 21 06:56:44 2003 From: =?iso-8859-1?q?Andr=E9_W=F6bbeking?= Date: Mon, 21 Jul 2003 06:56:44 +0000 To: kde-devel Subject: [PATCH]: KURLDrag::decode() and the use of explicit X-MARC-Message: https://marc.info/?l=kde-devel&m=105877167329559 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_s64G/bVPOaoLH3E" --Boundary-00=_s64G/bVPOaoLH3E Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, I sent this eMail two days ago to kde-core-devel but as I have no write=20 access to that list it wasn't approved yet :-( So I give it a try on=20 this list: the attached patch fixes KURLDrag::decode(). Right now an encoded URL is=20 encoded once more and not decoded (i.e. %B0 ('=B0') becomes %C3%82%C2%B0=20 if your local encoding is UTF-8 or if you use any other protocol than=20 file://). This bug could be avoided if the contructors of KURL would be explicit.=20 All the implicit casts in KDE and Qt make it difficult to read the code=20 (you don't see what happens) and make it easy to oversee bugs like in=20 KURLDrag::decode(). If you don't know what I mean then tell me what the=20 following code does: KURL url(42); With GCC 3.3 it compiles without any warning. Cheers, Andr=E9 P.S.: can I apply the patch? --Boundary-00=_s64G/bVPOaoLH3E Content-Type: text/x-diff; charset="us-ascii"; name="kurldrag.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kurldrag.patch" Index: kdecore/kurldrag.cpp =================================================================== RCS file: /home/kde/kdelibs/kdecore/kurldrag.cpp,v retrieving revision 1.19 diff -u -3 -p -r1.19 kurldrag.cpp --- kdecore/kurldrag.cpp 19 May 2003 11:02:42 -0000 1.19 +++ kdecore/kurldrag.cpp 19 Jul 2003 00:59:36 -0000 @@ -73,7 +73,7 @@ bool KURLDrag::decode( const QMimeSource QStrList lst; bool ret = QUriDrag::decode( e, lst ); for (QStrListIterator it(lst); *it; ++it) - uris.append(urlToString(*it)); + uris.append(stringToUrl(*it)); return ret; } --Boundary-00=_s64G/bVPOaoLH3E Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --Boundary-00=_s64G/bVPOaoLH3E--