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

List:       kde-core-devel
Subject:    Fwd: PATCH: fix url in status bar
From:       Daniel Naber <daniel.naber () t-online ! de>
Date:       2002-02-25 0:58:11
[Download RAW message or body]

hi,

i got no reply on kfm-devel, so i'll try here.

----------  Forwarded Message  ----------

Subject: PATCH: fix url in status bar
Date: Fri, 22 Feb 2002 02:45:30 +0100
From: Daniel Naber <daniel.naber@t-online.de>
To: kfm-devel@kde.org

hi,

this patch fixes the problem that the link displayed in the status bar is
wrong if it contains a query *and* has a target. i know it looks less
clean than the previous version, but it works: the query part is not lost
anymore. you can test it with the first section of the attached testcase.

can i commit?

regards
 daniel

--
http://www.danielnaber.de

-------------------------------------------------------



--=20
http://www.danielnaber.de

["links.html" (text/html)]

<html>
<body>

<p>links with queries (?...) and targets:</p>

<a href="http://lists.kde.org/?l=kde-kmail&amp;r=1&amp;w=2" \
target="_top">lists.kde.org, _top</a><br><br> <a \
href="http://lists.kde.org/?l=kde-kmail&amp;r=1&amp;w=2" \
target="_blank">lists.kde.org, _blank</a><br><br> <a \
href="http://lists.kde.org/?l=kde-kmail&amp;r=1&amp;w=2" \
target="_self">lists.kde.org, _self</a><br><br> <a \
href="http://lists.kde.org/?l=kde-kmail&amp;r=1&amp;w=2" \
target="_parent">lists.kde.org, _parent</a><br><br> <a \
href="http://lists.kde.org/?l=kde-kmail&amp;r=1&amp;w=2" target="blah">lists.kde.org, \
blah</a><br><br> <a href="http://lists.kde.org/?l=kde-kmail&amp;r=1&amp;w=2">lists.kde.org, \
no target</a><br><br>

<p>Spaces in URLs:</p>

<a href="http://lists.kde.org/?bla=foo bar">space in url</a><br><br>
<a href="http://lists.kde.org/?bla=foo%20bar">space as %20 in url</a><br><br>
<a href="http://lists.kde.org/?bla=foo+bar">space as + in url</a><br><br>

<p>

<a href="http://lists.kde.org/?()[]{}-,.#+'*äöüßÖÄÜ">specail chars</a><br><br>

</body>
</html>


["link_statusbar_target.diff" (text/x-diff)]

Index: khtml_part.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v
retrieving revision 1.662
diff -u -r1.662 khtml_part.cpp
--- khtml_part.cpp	2002/02/21 02:33:23	1.662
+++ khtml_part.cpp	2002/02/22 01:35:01
@@ -129,12 +129,12 @@
 static QString splitUrlTarget(const QString &url, QString *target=0)
 {
    QString result = url;
-   if(url.left(7) == "target:")
+   if(url.left(9) == "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;
 }


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

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