Fix UI freeze every 5 s
The settings main page exists from startup inside the closed dialog and its IP timer always ran: networkInfo() spawns nmcli twice synchronously on the GUI thread (~200 ms), stalling every animation. Poll only while the page is visible. Also write the qt.alive heartbeat without QSaveFile's fsync (bt-update only checks its mtime). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,9 +42,14 @@ Item {
|
||||
refreshIp()
|
||||
refreshBrightness()
|
||||
}
|
||||
// networkInfo() runs nmcli synchronously on the GUI thread (~200 ms), so
|
||||
// poll only while this page is on screen. The page exists from startup
|
||||
// inside the closed settings dialog; an always-running timer froze all
|
||||
// animations every 5 s.
|
||||
onVisibleChanged: if (visible) refreshIp()
|
||||
Timer {
|
||||
interval: 5000
|
||||
running: true
|
||||
running: page.visible
|
||||
repeat: true
|
||||
onTriggered: page.refreshIp()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user