Commit 3989f42a authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[DownloadJob] Report total size only if known

In case the download size isn't known, the browser reports -1

Differential Revision: https://phabricator.kde.org/D19857
parent 157d81ac
......@@ -108,7 +108,10 @@ void DownloadJob::update(const QJsonObject &payload)
it = payload.constFind(QStringLiteral("totalBytes"));
if (it != end) {
setTotalAmount(Bytes, it->toDouble());
const qlonglong totalAmount = it->toDouble();
if (totalAmount > -1) {
setTotalAmount(Bytes, totalAmount);
}
}
it = payload.constFind(QStringLiteral("bytesReceived"));
......
Markdown is supported
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