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

List:       kfm-devel
Subject:    Re: problem with web shortcuts (regression against KDE2)
From:       Daniel Naber <daniel.naber () t-online ! de>
Date:       2002-02-25 22:45:55
[Download RAW message or body]

On Monday 25 February 2002 15:28, David Faure wrote:

> > when you type a shortcut like gg:"daniel naber" this will lead to the
> > ill-formed query "daniel%20naber" on Google, i.e. the space is escaped
> > although it shouldn't. Without quotes, it works okay.
> >
> > This worked with KDE 2.2. I'd try to fix it if someone tells me where
> > I can find the relevant code.
>
> kdebase/kcontrol/ebrowsing/plugins/ikws/kuriikwsfiltereng.cpp
> KURISearchFilterEngine::searchQuery I think

Thanks, here's a patch. Is this okay? It fixes the problem, but I only use 
very basic features of the internet keywords (i.e. only gg:), so someone 
should check this.

Regards
 Daniel

-- 
http://www.danielnaber.de

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

Index: kuriikwsfiltereng.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/ebrowsing/plugins/ikws/kuriikwsfiltereng.cpp,v
retrieving revision 1.24
diff -u -r1.24 kuriikwsfiltereng.cpp
--- kuriikwsfiltereng.cpp	2001/12/29 16:59:23	1.24
+++ kuriikwsfiltereng.cpp	2002/02/25 22:43:42
@@ -182,7 +182,10 @@
 	// Back-substitute quoted strings (%20 -> " "):
 	{
 		int i = 0;
-		while ((i = userquery.find("%20")) != -1) userquery = userquery.replace(i, 3, " ");
+		while ((i = userquery.find("%20")) != -1)
+			userquery = userquery.replace(i, 3, " ");
+		for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it )
+			*it = (*it).replace(QRegExp("%20"), " ");
 	}
 
 	PIDDBG << "Generating substitution map:\n";


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

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