Commit 351c2a03 authored by Kåre Särs's avatar Kåre Särs
Browse files

Fix SystemLoadViewer freezing plasmashell

BUG: 348385
REVIEW: 125858
parent ba0ab7a3
......@@ -172,21 +172,21 @@ Item {
function fitCpuLoad(load) {
var x = load / maxCpuLoad;
if (isNaN(x)) {return 0;}
return x;
return Math.min(x, 1); // Ensure that we do not get values that might cause problems
}
function fitMemoryUsage(usage) {
var x = (usage / (parseFloat(dataSource.data[dataSource.memFree].value) +
parseFloat(dataSource.data[dataSource.memUsed].value)))
if (isNaN(x)) {return 0;}
return x;
return Math.min(x, 1);
}
function fitSwapUsage(usage) {
var x = (usage / (parseFloat(usage) + parseFloat(dataSource.data[dataSource.swapFree].value)))
if (isNaN(x)) {return 0;}
return x;
return Math.min(x, 1);
}
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