settings: bluetooth: switch from Component.onCompleted power event 23/19623/2 6.99.4 7.90.0 guppy/6.99.4 guppy_6.99.4 halibut/7.90.0 halibut_7.90.0
authorMatt Ranostay <matt.ranostay@konsulko.com>
Wed, 16 Jan 2019 06:46:15 +0000 (22:46 -0800)
committerMatt Ranostay <matt.ranostay@konsulko.com>
Wed, 16 Jan 2019 06:55:15 +0000 (06:55 +0000)
Race condition between QML components finishing loadings before libqtappfw
access can happen. So use the the onPowerChanged event as before, but to avoid
infinite loop of power changes don't changed checked field if already set.

Bug-AGL: SPEC-2004
Change-Id: Ie54ca405cab70e1bb909005dce602a56ccb0e8ba
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
app/bluetooth/Bluetooth.qml

index 32577bf..6c93b2e 100644 (file)
@@ -101,7 +101,7 @@ SettingPage {
             }
         }
 
-        Component.onCompleted: root.checked = bluetooth.power
+        onPowerChanged: if (!root.checked) root.checked = state
     }
 
     Text {