Use a Binding instead of a Connection for lights
commit91f7a026eb2b6d317aa1a26a32120c7480cd9029
authorMichael Terry <michael.terry@canonical.com>
dateTue 5 Aug 2014, 10:31 (12 years ago)
parent07147a1
qml/Panel/Indicators/IndicatorsLight.qml+4−7
@@ -27,12 +27,9 @@ QtObject {
2727 Component.onDestruction: Lights.state = Lights.Off
2828
2929 // QtObject does not have children
30− property var _connections: Connections {
31− id: powerConnection
32−
33− target: Powerd
34− onStatusChanged: {
35− Lights.state = (Powerd.status === Powerd.Off) ? Lights.On : Lights.Off
36− }
30+ property var _binding: Binding {
31+ target: Lights
32+ property: "state"
33+ value: (Powerd.status === Powerd.Off) ? Lights.On : Lights.Off
3734 }
3835}