Commit 30b4a718 authored by David Redondo's avatar David Redondo 🏎

Do not show absurdedly high speeds on first update

We initialise both byte amounts to 0 and onCompleted can run earlier than
the first update of the model.
parent 0fbf2b36
......@@ -216,8 +216,8 @@ PlasmaExtras.ExpandableListItem {
prevTxBytes = TxBytes
}
onTriggered: {
rxBytes = (RxBytes - prevRxBytes) * 1000 / interval
txBytes = (TxBytes - prevTxBytes) * 1000 / interval
rxBytes = prevRxBytes == 0 ? 0 : (RxBytes - prevRxBytes) * 1000 / interval
txBytes = prevTxBytes == 0 ? 0 : (TxBytes - prevTxBytes) * 1000 / interval
prevRxBytes = RxBytes
prevTxBytes = TxBytes
}
......
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