Commit 8e787760 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Downloads] Show hint when download is blocked

Prompting the user to accept it from the browser window.
Otherwise it would leave you wondering why the download
doesn't finish.
parent 3babd32f
...@@ -127,6 +127,17 @@ void DownloadJob::update(const QJsonObject &payload) ...@@ -127,6 +127,17 @@ void DownloadJob::update(const QJsonObject &payload)
m_mimeType = it->toString(); m_mimeType = it->toString();
} }
it = payload.constFind(QStringLiteral("danger"));
if (it != end) {
const QString danger = it->toString();
if (danger == QLatin1String("accepted")) {
// Clears previous danger message
infoMessage(this, QString());
} else if (danger != QLatin1String("safe")) {
infoMessage(this, i18n("This type of file can harm your computer. If you want to keep it, accept this download from the browser window."));
}
}
it = payload.constFind(QStringLiteral("incognito")); it = payload.constFind(QStringLiteral("incognito"));
if (it != end) { if (it != end) {
m_incognito = it->toBool(); m_incognito = it->toBool();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment