In case the download size isn't known, the browser reports -1
Details
Details
- Reviewers
fvogt - Group Reviewers
Plasma - Commits
- R856:3989f42ac5f0: [DownloadJob] Report total size only if known
It now shows "xyz MiB of 0 B" so we don't handle that in notifications but it's better than -1 B
Or should I explicitly setTotalAmount(0) in this case?
Diff Detail
Diff Detail
- Repository
- R856 Plasma Browser Integration
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
Other download managers show the downloaded amount as total amount, so it is e.g 25 MiB out of 25 MiB.
Comment Actions
It should just hide the total if unknown but that's an issue in the notification view
Comment Actions
Additionally, the bytesReceived > totalAmount case is currently not handled at all, but I'm not sure whether that's something for KJob or here.
host/downloadjob.cpp | ||
---|---|---|
111–114 | To avoid casting and rounding errors later on, I suggest to use const qlonglong totalAmount = it->toDouble(); here. |