Diffusion KMail c7d0d125140a

Fix Quota progress bar for quota limit of 2GB and more

Authored by gkowal on Aug 10 2018, 9:23 AM.

Description

Fix Quota progress bar for quota limit of 2GB and more

Summary:
Both functions of QProgressBar, setMaximum() and setValue(), accept arguments of int type, however arguments current and maxValue of setQuotaInfo() are of qint64 type. If any of these arguments exceeds the upper limit of int type (around 2GB) the progress bar is displayed incorrectly.

Fix this by directly calculating the percentage of used quota and passing it to setValue() and dropping the setting of maximum (which by default is 100).

Also, correctly round the percentage and make sure it is always in the correct range.

Reviewers: KDE PIM: KMail, vkrause

Reviewed By: vkrause

Subscribers: kde-pim

Tags: KDE PIM

Differential Revision: https://phabricator.kde.org/D14617

Details

Committed
dvratilAug 10 2018, 9:23 AM
Reviewer
vkrause
Differential Revision
D14617: Fix Quota progress bar for quota limit of 2GB and more
Parents
R206:d847287a32dc: Fix enable/disable print action
Branches
Unknown
Tags
Unknown