Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions plasmoid/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Item {
id: execute_ds
engine: "executable"

property var tick
property var tick: 0

// what data is requested from the systemmonitor data source
connectedSources: {
Expand Down Expand Up @@ -78,11 +78,12 @@ Item {
values[i] = normalize(orig_values, data.stdout, i)
}
}
var current_tick = Math.floor(Date.now() / 1000)
if (tick != current_tick) {
var current_tick = Date.now()
var time_spent = current_tick - tick
if (time_spent > interval ) {
valuesChanged()
orig_valuesChanged()
tick = current_tick
tick = tick + (Math.floor(time_spent / interval) * interval)
}
}

Expand All @@ -95,7 +96,7 @@ Item {
id: systemmonitor
engine: "systemmonitor"

property var tick
property var tick: 0

// what data is requested from the systemmonitor data source
connectedSources: {
Expand Down Expand Up @@ -126,11 +127,12 @@ Item {
values[i] = normalize(orig_values, data.value, i)
}
}
var current_tick = Math.floor(Date.now() / 1000)
if (tick != current_tick) {
var current_tick = Date.now()
var time_spent = current_tick - tick
if (time_spent > interval ) {
valuesChanged()
orig_valuesChanged()
tick = current_tick
tick = tick + (Math.floor(time_spent / interval) * interval)
}
}

Expand Down