systemusage: fix integer overflow
This commit is contained in:
parent
cebb6270e4
commit
3f981680ef
1 changed files with 7 additions and 7 deletions
|
|
@ -12,17 +12,17 @@ Singleton {
|
|||
property string gpuType: "NONE"
|
||||
property real gpuPerc
|
||||
property real gpuTemp
|
||||
property int memUsed
|
||||
property int memTotal
|
||||
property real memUsed
|
||||
property real memTotal
|
||||
readonly property real memPerc: memTotal > 0 ? memUsed / memTotal : 0
|
||||
property int storageUsed
|
||||
property int storageTotal
|
||||
property real storageUsed
|
||||
property real storageTotal
|
||||
property real storagePerc: storageTotal > 0 ? storageUsed / storageTotal : 0
|
||||
|
||||
property int lastCpuIdle
|
||||
property int lastCpuTotal
|
||||
property real lastCpuIdle
|
||||
property real lastCpuTotal
|
||||
|
||||
function formatKib(kib: int): var {
|
||||
function formatKib(kib: real): var {
|
||||
const mib = 1024;
|
||||
const gib = 1024 ** 2;
|
||||
const tib = 1024 ** 3;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue