summaryrefslogtreecommitdiff
path: root/src/webpage.cpp
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2010-02-21 13:10:36 +0100
committermegabigbug <megabigbug@arrakis.(none)>2010-02-21 13:10:36 +0100
commit49a6031c6bd03fee2c4130fa05e5ae52d9f826e3 (patch)
tree18694177e49738c3eb2a8dfc0db1a4de6adc1e1a /src/webpage.cpp
parentadd an url with japanese chars for test kget download (diff)
downloadrekonq-49a6031c6bd03fee2c4130fa05e5ae52d9f826e3.tar.xz
remove duplicate links
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r--src/webpage.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 872766ff..252a9e93 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -334,22 +334,22 @@ void WebPage::downloadRequest(const QNetworkRequest &request)
void WebPage::downloadAllContentsWithKGet()
{
- QList<QString> contentList;
+ QSet<QString> contents;
KUrl baseUrl(m_requestedUrl);
KUrl relativeUrl;
QWebElementCollection images = mainFrame()->documentElement().findAll("img");
foreach(QWebElement img, images)
{
- relativeUrl.setEncodedUrl(img.attribute("src").toUtf8(),KUrl::TolerantMode);
- contentList.append(QString(baseUrl.resolved(relativeUrl).toEncoded()));
+ relativeUrl.setEncodedUrl(img.attribute("src").toUtf8(),KUrl::TolerantMode);
+ contents << baseUrl.resolved(relativeUrl).toString();
}
QWebElementCollection links = mainFrame()->documentElement().findAll("a");
foreach(QWebElement link, links)
{
relativeUrl.setEncodedUrl(link.attribute("href").toUtf8(),KUrl::TolerantMode);
- contentList.append(QString(baseUrl.resolved(relativeUrl).toEncoded()));
+ contents << baseUrl.resolved(relativeUrl).toString();
}
if(!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kget"))
@@ -357,5 +357,5 @@ void WebPage::downloadAllContentsWithKGet()
KToolInvocation::kdeinitExecWait("kget");
}
QDBusInterface kget("org.kde.kget", "/KGet", "org.kde.kget.main");
- kget.call("importLinks", QVariant(contentList));
+ kget.call("importLinks", QVariant(contents.toList()));
}