From 2dc9e2f2127f6c12e0b7f7be970b0f5255bf164e Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Wed, 10 Sep 2025 21:29:11 -0400 Subject: [PATCH] Bluetooth: proper synchronisation of the adapter state with the cached setting --- Modules/BluetoothPanel/BluetoothPanel.qml | 2 +- Services/BluetoothService.qml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Modules/BluetoothPanel/BluetoothPanel.qml b/Modules/BluetoothPanel/BluetoothPanel.qml index fa65dfc..ac78db3 100644 --- a/Modules/BluetoothPanel/BluetoothPanel.qml +++ b/Modules/BluetoothPanel/BluetoothPanel.qml @@ -75,7 +75,7 @@ NPanel { } Rectangle { - visible: !Settings.data.network.bluetoothEnabled + visible: !(BluetoothService.adapter && BluetoothService.adapter.enabled) Layout.fillWidth: true Layout.fillHeight: true color: Color.transparent diff --git a/Services/BluetoothService.qml b/Services/BluetoothService.qml index 9bbc55b..cfdb5a7 100644 --- a/Services/BluetoothService.qml +++ b/Services/BluetoothService.qml @@ -32,6 +32,16 @@ Singleton { function init() { Logger.log("Bluetooth", "Service initialized") + delaySyncState.running = true + } + + Timer { + id: delaySyncState + interval: 1000 + repeat: false + onTriggered: { + Settings.data.network.bluetoothEnabled = adapter.enabled + } } Timer {