Bluetooth: proper synchronisation of the adapter state with the cached setting
This commit is contained in:
parent
62a3b343cf
commit
2dc9e2f212
2 changed files with 11 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ NPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
visible: !Settings.data.network.bluetoothEnabled
|
visible: !(BluetoothService.adapter && BluetoothService.adapter.enabled)
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
color: Color.transparent
|
color: Color.transparent
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,16 @@ Singleton {
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
Logger.log("Bluetooth", "Service initialized")
|
Logger.log("Bluetooth", "Service initialized")
|
||||||
|
delaySyncState.running = true
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: delaySyncState
|
||||||
|
interval: 1000
|
||||||
|
repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
Settings.data.network.bluetoothEnabled = adapter.enabled
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue