Skip to content

Commit 8deaaf4

Browse files
committed
improve readyForCapture logic and enhance error handling
1 parent 42319ae commit 8deaaf4

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

qml/content/CameraSource.qml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Item
1111

1212
property alias output: output
1313
property string cameraName: ""
14-
property alias readyForCapture: cameraSession.imageCapture.readyForCapture
14+
property bool readyForCapture: ((cameraSession.imageCapture.readyForCapture) || (cameraSource.state === "GPhotoCamera"))
1515

1616
signal imageCaptured(var image)
1717
signal errorOccurred(var errorString)
@@ -76,10 +76,12 @@ Item
7676
{
7777
if(state === "StandardCamera")
7878
{
79+
console.log("Standard camera capture")
7980
cameraSession.imageCapture.capture()
8081
}
8182
else if(state === "GPhotoCamera")
8283
{
84+
console.log("GPhoto capture")
8385
gphotoCamera.captureImage()
8486
}
8587
else
@@ -96,13 +98,13 @@ Item
9698
id: gphotoCamera
9799

98100
onErrorOccurred: function(errorString) {
99-
errorOccured(errorString)
101+
cameraSource.errorOccurred(errorString)
100102
}
101103
onImageCaptured: function(image) {
102-
imageCaptured(image)
104+
cameraSource.imageCaptured(image)
103105
}
104106
onCaptureError: function(errorString) {
105-
errorOccured(errorString)
107+
cameraSource.errorOccurred(errorString)
106108
}
107109
}
108110

@@ -138,7 +140,7 @@ Item
138140
cameraSource.imageCaptured(preview)
139141
}
140142
onErrorOccurred: {
141-
errorOccurred(errorString)
143+
cameraSource.errorOccurred(errorString)
142144
}
143145
}
144146
}

0 commit comments

Comments
 (0)