diff options
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r-- | src/webpage.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index 2fdf4d01..6a6f1bc9 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -306,7 +306,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) { isLocal ? KMessageBox::sorry(view(), i18n("No service can handle this file.")) - : downloadReply(reply, _suggestedFileName); + : downloadUrl(reply->url()); return; } @@ -323,10 +323,17 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) if (!_suggestedFileName.isEmpty()) dlg.setSuggestedFileName(_suggestedFileName); + // read askEmbedOrSave preferences. If we don't have to show dialog and rekonq settings are + // to automatically choose download dir, we won't show local dir choose dialog + KConfigGroup cg = KConfigGroup(KSharedConfig::openConfig("filetypesrc", KConfig::NoGlobals), QL1S("Notification Messages")); + bool hideDialog = cg.readEntry(QL1S("askEmbedOrSave") + _mimeType, false); + + kDebug() << "Hide dialog for " << _mimeType << "? " << hideDialog; + switch (dlg.askEmbedOrSave()) { case KParts::BrowserOpenOrSaveQuestion::Save: - downloadReply(reply, _suggestedFileName); + rApp->downloadManager()->downloadResource(reply->url(), KIO::MetaData(), view(), !hideDialog, _suggestedFileName); return; case KParts::BrowserOpenOrSaveQuestion::Cancel: @@ -544,12 +551,6 @@ QString WebPage::errorPage(QNetworkReply *reply) } -void WebPage::downloadReply(const QNetworkReply *reply, const QString &suggestedFileName) -{ - rApp->downloadManager()->downloadResource(reply->url(), KIO::MetaData(), view(), suggestedFileName); -} - - void WebPage::downloadRequest(const QNetworkRequest &request) { rApp->downloadManager()->downloadResource(request.url(), |