Settings BT: fix toggle not reactive if no BT adapter
This commit is contained in:
parent
64d7ae2e13
commit
ad0d3f4883
1 changed files with 2 additions and 1 deletions
|
|
@ -69,8 +69,9 @@ ColumnLayout {
|
|||
description: "Turn Bluetooth radio on or off"
|
||||
value: Settings.settings.bluetoothEnabled
|
||||
onToggled: function() {
|
||||
Settings.settings.bluetoothEnabled = !Settings.settings.bluetoothEnabled;
|
||||
if (Bluetooth.defaultAdapter) {
|
||||
Settings.settings.bluetoothEnabled = !Settings.settings.bluetoothEnabled;
|
||||
|
||||
Bluetooth.defaultAdapter.enabled = Settings.settings.bluetoothEnabled;
|
||||
if (Bluetooth.defaultAdapter.enabled)
|
||||
Bluetooth.defaultAdapter.discovering = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue