Reworked preview animation
[harmattan/cameraplus] / qml / PipelineManager.qml
index 458885a..0ef0a68 100644 (file)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-import QtQuick 1.1
+import QtQuick 2.0
 import QtCamera 1.0
 import CameraPlus 1.0
 
@@ -60,11 +60,14 @@ Item {
     function startCamera() {
         if (error) {
             return
-        } else if ((currentPolicyMode == currentItem.policyMode) && cam.running) {
+        } else if ((currentPolicyMode == currentItem.policyMode) && camera.running) {
             return
         } else if (!policy.acquire(currentItem.policyMode)) {
             console.log("Failed to acquire policy resources")
             return
+        } else if (currentItem.policyMode == CameraResources.Player) {
+            currentPolicyMode = CameraResources.Player
+            camera.stop(true)
         } else if (!camera.start()) {
             showError(qsTr("Failed to start camera. Please restart the application."))
         } else {