From c636dcebc755fd75fbb5e475f0e9e4f16e11ccc7 Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Sun, 15 Sep 2013 16:49:40 +0300 Subject: [PATCH] Bind checked property to the corresponding setting value for CameraTextSwitch Seems we don't get the binding loop errors anymore. --- qml/CameraSettings.qml | 31 +++++++------------------------ qml/ImageModeSettings.qml | 4 +--- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/qml/CameraSettings.qml b/qml/CameraSettings.qml index c25a722..9791aa8 100644 --- a/qml/CameraSettings.qml +++ b/qml/CameraSettings.qml @@ -63,10 +63,7 @@ Column { CameraTextSwitch { text: qsTr("Show grid lines") - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.gridEnabled - + checked: settings.gridEnabled onCheckedChanged: settings.gridEnabled = checked } @@ -84,37 +81,28 @@ Column { CameraTextSwitch { text: qsTr("Use zoom keys for capture") - - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.zoomAsShutter + checked: settings.zoomAsShutter onCheckedChanged: settings.zoomAsShutter = checked } CameraTextSwitch { text: qsTr("Use proximity sensor for capture") - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.proximityAsShutter + checked: settings.proximityAsShutter onCheckedChanged: settings.proximityAsShutter = checked } CameraTextSwitch { text: qsTr("Enable camera sounds") - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.soundEnabled + checked: settings.soundEnabled onCheckedChanged: settings.soundEnabled = checked } CameraTextSwitch { text: qsTr("Preview images and videos after capturing") visible: false - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.enablePreview + checked: settings.enablePreview onCheckedChanged: settings.enablePreview = checked } @@ -122,9 +110,7 @@ Column { id: useGps text: qsTr("Use GPS") - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.useGps + checked: settings.useGps onCheckedChanged: settings.useGps = checked } @@ -133,10 +119,7 @@ Column { visible: useGps.checked text: qsTr("Use geotags") - - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.useGeotags + checked: settings.useGeotags onCheckedChanged: settings.useGeotags = checked } } diff --git a/qml/ImageModeSettings.qml b/qml/ImageModeSettings.qml index 4ea5314..0267659 100644 --- a/qml/ImageModeSettings.qml +++ b/qml/ImageModeSettings.qml @@ -49,9 +49,7 @@ Flickable { CameraTextSwitch { text: qsTr("Enable face detection") - // We have to do it that way because QML complains about a binding - // loop for checked if we bind the checked property to the settings value. - Component.onCompleted: checked = settings.faceDetectionEnabled + checked: settings.faceDetectionEnabled onCheckedChanged: settings.faceDetectionEnabled = checked visible: camera ? !camera.quirks.hasQuirk(Quirks.NoFaceDetection) : false } -- 2.25.1