diff options
-rw-r--r-- | src/webpage.cpp | 37 |
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; } |