Use Qt.application.active instead of platformWindow.active
authorMohammed Sameer <msameer@foolab.org>
Fri, 14 Sep 2012 15:53:56 +0000 (18:53 +0300)
committerMohammed Sameer <msameer@foolab.org>
Fri, 14 Sep 2012 15:53:56 +0000 (18:53 +0300)
platformWindow.active gets toggled from true to false and back to true upon startup.

qml/CameraPage.qml
qml/VideoPage.qml
qml/main.qml

index 4ba3bc0..b89aec5 100644 (file)
@@ -13,13 +13,13 @@ Page {
         property int policyMode: CameraResources.None
 
         Component.onCompleted: {
-                if (platformWindow.active && needsPipeline) {
+                if (Qt.application.active && needsPipeline) {
                         resourcePolicy.acquire(page.policyMode);
                 }
         }
 
         onStatusChanged: {
-                if (platformWindow.active && status == PageStatus.Activating) {
+                if (Qt.application.active && status == PageStatus.Activating) {
                         resourcePolicy.acquire(page.policyMode);
                 }
         }
@@ -32,13 +32,13 @@ Page {
 */
 
         onPolicyModeChanged: {
-                if (platformWindow.active) {
+                if (Qt.application.active) {
                         resourcePolicy.acquire(page.policyMode);
                 }
         }
 
         function handlePipeline() {
-                if (!platformWindow.active) {
+                if (!Qt.application.active) {
                         // TODO: force if we lost resources ?
                         cam.stop();
                 }
@@ -58,9 +58,9 @@ Page {
         }
 
         Connections {
-                target: platformWindow
+                target: Qt.application
                 onActiveChanged: {
-                        if (!platformWindow.active) {
+                        if (!Qt.application.active) {
                                 // This is a noop if camera is not
                                 // idle so calling it will not hurt
                                 if (cam.stop()) {
@@ -76,7 +76,7 @@ Page {
         Connections {
                 target: cam
                 onIdleChanged: {
-                        if (cam.idle && !platformWindow.active) {
+                        if (cam.idle && !Qt.application.active) {
                                 cam.stop();
                                 resourcePolicy.acquire(CameraResources.None);
                         }
@@ -95,7 +95,7 @@ Page {
                 id: standby
                 color: "black"
                 anchors.fill: parent
-                visible: !platformWindow.active || !cam.running || !resourcePolicy.acquired
+                visible: !Qt.application.active || !cam.running || !resourcePolicy.acquired
                 Image {
                         source: "image://theme/icon-l-camera-standby"
                         anchors.centerIn: parent
index 18ddd39..29db16d 100644 (file)
@@ -70,9 +70,9 @@ CameraPage {
         }
 
         Connections {
-                target: platformWindow
+                target: Qt.application
                 onActiveChanged: {
-                        if (!platformWindow.active && videoMode.recording) {
+                        if (!Qt.application.active && videoMode.recording) {
                                 videoMode.stopRecording();
                         }
                 }
index 2825765..7258d1b 100644 (file)
@@ -16,17 +16,16 @@ import QtMobility.systeminfo 1.2
 // TODO: indicators
 // TODO: portrait/landscape
 // TODO: record video in a hidden directory and then copy the video to avoid tracker indexing it.
-// TODO: stop viewfinder in postcapture and settings pages ?
-// TODO: resource policy
+// TODO: stop viewfinder in settings pages ?
 // TODO: prevent going to mass storage while recording and capturing
 // TODO: sounds
-// TODO: grid lines, face tracking
+// TODO: grid lines, face tracking, ambr
 // TODO: complete settings pages
 // TODO: stop camera properly when we get closed.
 // TODO: select primary/secondary camera.
 // TODO: disable debug builds.
-// TODO: seems start gets called when we are shutting down
-// TODO: seems start gets called twice when we are starting up if screen is locked or dimmed ?!
+// TODO: a way to get buffers to the application
+// TODO: fcam like functionality (precise control over capture parameters).
 
 PageStackWindow {
         id: root