fix duplicate onActiveChanged in cpu applet

This commit is contained in:
Damocles 2026-04-27 18:21:32 +02:00
parent d85b65c6d9
commit e7bf175169

View file

@ -11,6 +11,7 @@ Column {
required property color accentColor required property color accentColor
property bool active: true property bool active: true
property bool locked: false
property bool _coreActive: false property bool _coreActive: false
onActiveChanged: { onActiveChanged: {
@ -21,6 +22,8 @@ Column {
_coreActive = false; _coreActive = false;
S.SystemStats.coreConsumers--; S.SystemStats.coreConsumers--;
} }
if (active)
_cpuHistory = [];
} }
Component.onDestruction: if (_coreActive) Component.onDestruction: if (_coreActive)
S.SystemStats.coreConsumers-- S.SystemStats.coreConsumers--
@ -171,8 +174,6 @@ Column {
} }
property var _cpuHistory: [] property var _cpuHistory: []
onActiveChanged: if (active)
_cpuHistory = []
Connections { Connections {
target: S.SystemStats target: S.SystemStats
function onCpuUsageChanged() { function onCpuUsageChanged() {