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

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

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 
returned, not only the hostname or hostname plus path but without query. 
This function is used to display the url in the status bar, so it's very 
confusing if there's a "blah.php?id=2" URL but the user can only see 
"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 uses 
of splitUrlTarget() (grep shows 6, all in khtml_part.cpp), I don't know 
the code so I cannot decide.

Slightly improved patch attached.

Regards
 Daniel

-- 
http://www.danielnaber.de

["link_statusbar_target.diff" (text/x-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;
 }


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

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