[rekonq] Rekonq bug report (with patch)
Andrea Diamantini
adjam7 at gmail.com
Sat Feb 20 15:33:24 CET 2010
On Friday 19 February 2010 21:59:09 Tom Gundersen wrote:
> Hi Adjam,
>
> I have recently started using rekonq and I love it! Great work!
>
> I noticed that when using the KGet integration "List All Links",
> relative links are passed directly to KGet without merging them with
> the "base URL" (so KGet could of course not download the files).
>
> The below patch works for me, but I am no Qt expert, so I have serious
> doubts if it works the way it should in all situations (%encoding of
> url's in particular). Please consider it more as a bug report than a
> merge request :-)
>
> Keep up the great work,
>
> Tom
>
> From 4776e41436138c9c506b05470cc61f41691a2a71 Mon Sep 17 00:00:00 2001
> From: Tom Gundersen <teg at jklm.no>
> Date: Mon, 15 Feb 2010 18:02:01 +0100
> Subject: [PATCH] Allow to list relative links with KGet
>
> Relative links were passed to KGet directly, this merges relative links
> with their base.
> ---
> src/webpage.cpp | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/webpage.cpp b/src/webpage.cpp
> index ea05c15..367fe55 100644
> --- a/src/webpage.cpp
> +++ b/src/webpage.cpp
> @@ -336,17 +336,21 @@ void WebPage::downloadRequest(const
> QNetworkRequest &request)
> void WebPage::downloadAllContentsWithKGet()
> {
> QList<QString> contentList;
> + KUrl baseUrl(m_requestedUrl);
> + KUrl relativeUrl;
>
> QWebElementCollection images =
> mainFrame()->documentElement().findAll("img");
> foreach(QWebElement img, images)
> {
> - contentList.append(img.attribute("src"));
> +
> relativeUrl.setEncodedUrl(img.attribute("src").toUtf8(),KUrl::TolerantMode
> ); +
> contentList.append(QString(baseUrl.resolved(relativeUrl).toEncoded())); }
>
> QWebElementCollection links =
> mainFrame()->documentElement().findAll("a"); foreach(QWebElement link,
> links)
> {
> - contentList.append(link.attribute("href"));
> +
> relativeUrl.setEncodedUrl(link.attribute("href").toUtf8(),KUrl::TolerantMo
> de); +
> contentList.append(QString(baseUrl.resolved(relativeUrl).toEncoded())); }
>
>
> if(!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kd
> e.kget"))
Hi Tom,
I'm redirecting your mail to rekonq mailing list.
You'll find everyone involved in rekonq development there :)
I didn't implement myself the kget integration code. Lionel Chauvin did. I'll
be happy if he could review your patch.
Regards,
--
Andrea Diamantini, adjam
GPG Fingerprint: 57DE 8E32 7D1A 0E16 AA52 59D8 84F9 3ECD DBF9 730F
rekonq project
WEB: http://rekonq.sourceforge.net
IRC: rekonq at freenode
More information about the rekonq
mailing list