diff --git a/qml/settings/MainPage.qml b/qml/settings/MainPage.qml index 10b434c..afe80ff 100644 --- a/qml/settings/MainPage.qml +++ b/qml/settings/MainPage.qml @@ -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() } diff --git a/src/systeminfo.cpp b/src/systeminfo.cpp index e335734..529d6cd 100644 --- a/src/systeminfo.cpp +++ b/src/systeminfo.cpp @@ -55,12 +55,13 @@ QString SystemInfo::scriptsDir() const void SystemInfo::writeHeartbeat() { - QSaveFile f(runDir() + "/qt.alive"); + // Runs on the GUI thread every 5 s. Plain write, no QSaveFile: its + // commit() fsyncs, which on eMMC can stall the UI for a visible moment. + // bt-update only looks at the mtime, so atomicity is not needed. + QFile f(runDir() + "/qt.alive"); if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) return; - QByteArray ts = QByteArray::number(QDateTime::currentSecsSinceEpoch()); - f.write(ts); - f.commit(); + f.write(QByteArray::number(QDateTime::currentSecsSinceEpoch())); } QString SystemInfo::appVersion() const