Commit 564b06d3 authored by David Edmundson's avatar David Edmundson
Browse files

Fix system loadviewer results

SystemLoadViewer Dataengine gives us undefined values at startup.

We need an immediate fix in Plasma stable so check bad values on the JS
side.

BUG: 348385
parent b971d1e1
......@@ -170,16 +170,23 @@ Item {
}
function fitCpuLoad(load) {
return load / maxCpuLoad
var x = load / maxCpuLoad;
if (isNaN(x)) {return 0;}
return x;
}
function fitMemoryUsage(usage) {
return (usage / (parseFloat(dataSource.data[dataSource.memFree].value) +
var x = (usage / (parseFloat(dataSource.data[dataSource.memFree].value) +
parseFloat(dataSource.data[dataSource.memUsed].value)))
if (isNaN(x)) {return 0;}
return x;
}
function fitSwapUsage(usage) {
return (usage / (parseFloat(usage) + parseFloat(dataSource.data[dataSource.swapFree].value)))
var x = (usage / (parseFloat(usage) + parseFloat(dataSource.data[dataSource.swapFree].value)))
if (isNaN(x)) {return 0;}
return x;
}
function columnCount() {
......
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