From kde-core-devel Wed Feb 27 17:04:44 2002 From: Daniel Naber Date: Wed, 27 Feb 2002 17:04:44 +0000 To: kde-core-devel Subject: Re: Fwd: PATCH: fix url in status bar X-MARC-Message: https://marc.info/?l=kde-core-devel&m=101483378511464 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------Boundary-00=_WFB7MLUBW829F4M3SIV7" --------------Boundary-00=_WFB7MLUBW829F4M3SIV7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wednesday 27 February 2002 17:13, Carsten Pfeiffer wrote: > - url.mid( 9, split_pos-10 ) is supposed to return the hostname of url, > right? But that is only the cause if there is no path in the url, > AFAICS. No, that's almost the bug I'm trying to fix: the complete URL should be=20 returned, not only the hostname or hostname plus path but without query.=20 This function is used to display the url in the status bar, so it's very=20 confusing if there's a "blah.php?id=3D2" URL but the user can only see=20 "blah.php" - that's the problem that's fixed by my patch. So the question is: does this patch lead to regressions with the other us= es=20 of splitUrlTarget() (grep shows 6, all in khtml_part.cpp), I don't know=20 the code so I cannot decide. Slightly improved patch attached. Regards Daniel --=20 http://www.danielnaber.de --------------Boundary-00=_WFB7MLUBW829F4M3SIV7 Content-Type: text/x-diff; charset="us-ascii"; name="link_statusbar_target.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="link_statusbar_target.diff" Index: khtml_part.cpp =================================================================== RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v retrieving revision 1.664 diff -u -r1.664 khtml_part.cpp --- khtml_part.cpp 2002/02/25 18:22:40 1.664 +++ khtml_part.cpp 2002/02/27 16:55:51 @@ -129,12 +129,12 @@ static QString splitUrlTarget(const QString &url, QString *target=0) { QString result = url; - if(url.left(7) == "target:") + if(url.startsWith("target://")) { - KURL u(url); - result = u.ref(); + int split_pos = url.find('#'); + result = url.mid(split_pos+1); if (target) - *target = u.host(); + *target = url.mid(9, split_pos-10); } return result; } --------------Boundary-00=_WFB7MLUBW829F4M3SIV7--