Fix binding loop
authorLuciano Montanaro <mikelima@cirulla.net>
Mon, 9 Jan 2012 01:20:47 +0000 (02:20 +0100)
committerLuciano Montanaro <mikelima@cirulla.net>
Mon, 9 Jan 2012 01:20:47 +0000 (02:20 +0100)
application/resources/harmattan/qml/StationListPage.qml

index 4f1244a..7bcc5f9 100644 (file)
@@ -16,7 +16,6 @@ Page {
     Menu {
         id: menu
         content: MenuLayout {
-
             MenuItem {
                 text: qsTr("Update Periodically")
                 Switch {
@@ -26,14 +25,14 @@ Page {
                         right: parent.right
                         rightMargin: UiConstants.DefaultMargin
                     }
-                    checked: settings.autoUpdate
+                    onCheckedChanged: settings.autoUpdate = checked
                 }
-                onClicked: settings.autoUpdate ^= true
             }
             MenuItem {
                 text: qsTr("About Quando Parte")
                 onClicked: Private.showAboutPage()
             }
+            Component.onCompleted: periodicCheckSwitch.checked = settings.autoUpdate
         }
     }
     PageHeader {