summaryrefslogtreecommitdiff
path: root/src/webpage.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-08-13 13:03:29 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-08-13 13:03:29 +0200
commit55376783e4b738414eb2d0c83a01c68c6342650c (patch)
tree21216c53ce9faca3c6bf28a5bcac86690f29ed6a /src/webpage.cpp
parentApplied patch from Johannes Zellner about {Middle,CTRL} clicking (diff)
downloadrekonq-55376783e4b738414eb2d0c83a01c68c6342650c.tar.xz
Just downloading not handled files
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r--src/webpage.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 2bc054a4..45cf82d7 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -142,26 +142,27 @@ void WebPage::slotHandleUnsupportedContent(QNetworkReply *reply)
QString mimetype = reply->header(QNetworkRequest::ContentTypeHeader).toString();
KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimetype);
- KParts::BrowserRun::AskSaveResult res = KParts::BrowserRun::askSave(
- url,
- offer,
- mimetype,
- filename
- );
- switch (res)
+ if( offer.isNull() ) // no service can handle this. We can just download it..
{
- case KParts::BrowserRun::Save:
- slotDownloadRequested(reply->request());
- return;
- case KParts::BrowserRun::Cancel:
- return;
- default: // non extant case
- break;
+ slotDownloadRequested(reply->request());
+ }
+ else
+ {
+ switch ( KParts::BrowserRun::askSave( url, offer, mimetype, filename ) )
+ {
+ case KParts::BrowserRun::Save:
+ slotDownloadRequested(reply->request());
+ return;
+ case KParts::BrowserRun::Cancel:
+ return;
+ default: // non extant case
+ break;
+ }
+ // case KParts::BrowserRun::Open
+ KUrl::List list;
+ list.append(url);
+ KRun::run(*offer,url,0);
}
-
- KUrl::List list;
- list.append(url);
- KRun::run(*offer,url,0);
}
return;
}