summaryrefslogtreecommitdiff
path: root/src/webpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r--src/webpage.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 00745445..4a8c8b6b 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -113,6 +113,9 @@ static bool downloadResource (const KUrl& srcUrl, const KIO::MetaData& metaData
do
{
destUrl = KFileDialog::getSaveFileName(fileName, QString(), parent);
+
+ if(destUrl.isEmpty())
+ return false;
if (destUrl.isLocalFile())
{
@@ -615,14 +618,14 @@ void WebPage::downloadAllContentsWithKGet(QPoint)
KUrl relativeUrl;
QWebElementCollection images = mainFrame()->documentElement().findAll("img");
- foreach(QWebElement img, images)
+ foreach(const QWebElement &img, images)
{
relativeUrl.setEncodedUrl(img.attribute("src").toUtf8(), KUrl::TolerantMode);
contents << baseUrl.resolved(relativeUrl).toString();
}
QWebElementCollection links = mainFrame()->documentElement().findAll("a");
- foreach(QWebElement link, links)
+ foreach(const QWebElement &link, links)
{
relativeUrl.setEncodedUrl(link.attribute("href").toUtf8(), KUrl::TolerantMode);
contents << baseUrl.resolved(relativeUrl).toString();