diff options
author | megabigbug <megabigbug@arrakis.(none)> | 2010-02-21 12:24:19 +0100 |
---|---|---|
committer | megabigbug <megabigbug@arrakis.(none)> | 2010-02-21 12:24:19 +0100 |
commit | f02d3a7ecd4e53af215bcec14ef1480cba9840ed (patch) | |
tree | 9a5396c8068498b6a4a1233acbdda6be356231d6 /src | |
parent | rekonq 0.3.94 (diff) | |
download | rekonq-f02d3a7ecd4e53af215bcec14ef1480cba9840ed.tar.xz |
handle relative urls (needs test with particular encoding)
Diffstat (limited to 'src')
-rw-r--r-- | src/webpage.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index ce2d5e40..872766ff 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -335,17 +335,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::TolerantMode); + contentList.append(QString(baseUrl.resolved(relativeUrl).toEncoded())); } if(!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kget")) |