From f43f31a8efabcf160d6897191f99d173aa9f5c64 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 15 Sep 2026 10:06:49 +0200 Subject: fix(desktop): stop bluetooth and wifi scans after 60s Neither scan property self-terminates. BlueZ discovery runs until StartDiscovery is stopped, and the NetworkManager scanner repeats until disabled; the docs for both say as much and give no timeout or interval property. The scan button was the only writer of either property, and closing the drawer destroys the page without touching them, so a scan started and forgotten kept the radio busy for the rest of the session. Continuous wifi scanning also costs throughput on the connected link. Each page gets a Timer bound to the scan property rather than started by the button. Binding it that way means a manual stop cancels the clock, and reopening the page on a scan still running from an earlier visit re-arms a fresh 60s instead of leaving it running forever. Verified both files parse: the desktop shell hot-reloaded without dropping its process. The timeout firing at 60s is not verified here, since it needs a real scan on the radio. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01A7ThHHh5iTYbVfp3rNAkw2 --- desktop/modules/network/NetworkPage.qml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'desktop/modules/network') diff --git a/desktop/modules/network/NetworkPage.qml b/desktop/modules/network/NetworkPage.qml index 975e68c..3749688 100644 --- a/desktop/modules/network/NetworkPage.qml +++ b/desktop/modules/network/NetworkPage.qml @@ -127,6 +127,15 @@ Column { text: page.net.wifiDevice && page.net.wifiDevice.scannerEnabled ? "Scanning…" : "Scan" onClicked: if (page.net.wifiDevice) page.net.wifiDevice.scannerEnabled = !page.net.wifiDevice.scannerEnabled } + + // The scanner repeats until disabled, and closing the drawer does not + // disable it. A continuous scan also costs throughput on the connected + // link. See the matching timer in BluetoothPage. + Timer { + interval: 60000 + running: page.net.wifiDevice ? page.net.wifiDevice.scannerEnabled : false + onTriggered: if (page.net.wifiDevice) page.net.wifiDevice.scannerEnabled = false + } } Repeater { -- cgit v1.2.3