201035_1
authorhgs
Fri, 03 Sep 2010 11:00:58 +0300
changeset 55 0da2a5b56583
parent 52 7e18d488ac5f
child 58 ddba9caa7f32
201035_1
camerauis/cameraxui/cxengine/conf/backup_registration.xml
camerauis/cameraxui/cxengine/cxengine.pro
camerauis/cameraxui/cxengine/inc/api/cxutils.h
camerauis/cameraxui/cxengine/inc/cxestillcapturecontroldesktop.h
camerauis/cameraxui/cxengine/inc/cxevideocapturecontroldesktop.h
camerauis/cameraxui/cxengine/inc/cxeviewfindercontroldesktop.h
camerauis/cameraxui/cxengine/src/cxecameradevicedesktop.cpp
camerauis/cameraxui/cxengine/src/cxegeotaggingtrail_symbian_p.cpp
camerauis/cameraxui/cxengine/src/cxequalitypresetssymbian.cpp
camerauis/cameraxui/cxengine/src/cxesoundplayersymbian.cpp
camerauis/cameraxui/cxengine/src/cxestillcapturecontroldesktop.cpp
camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp
camerauis/cameraxui/cxengine/src/cxethumbnailmanagersymbian.cpp
camerauis/cameraxui/cxengine/src/cxevideocapturecontroldesktop.cpp
camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp
camerauis/cameraxui/cxengine/src/cxeviewfindercontroldesktop.cpp
camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.cpp
camerauis/cameraxui/cxengine/tsrc/unit/system_include/thumbnailmanager_qt.cpp
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevicecontrolsymbian/unittest_cxecameradevicecontrolsymbian.cpp
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefeaturemanagerimp/unittest_cxefeaturemanagerimp.pro
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilenamegeneratorsymbian/unittest_cxefilenamegeneratorsymbian.cpp
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.pro
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxememorymonitor/unittest_cxememorymonitor.cpp
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.cpp
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.cpp
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.pro
camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp
camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h
camerauis/cameraxui/cxui/inc/cxuistillprecaptureview.h
camerauis/cameraxui/cxui/layouts/image_setting.xml
camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp
camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp
camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlistmodel.cpp
camerauis/cameraxui/cxui/src/cxuisettingsinfo.cpp
camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp
camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp
camerauis/cameraxui/cxui/src/cxuiview.cpp
camerauis/cameraxui/rom/camerax.iby
package_definition.xml
package_map.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/conf/backup_registration.xml	Fri Sep 03 11:00:58 2010 +0300
@@ -0,0 +1,22 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!--
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* 
+-->
+
+<backup_registration>
+    <proxy_data_manager SID="0x10202BE9" />
+</backup_registration>
--- a/camerauis/cameraxui/cxengine/cxengine.pro	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/cxengine.pro	Fri Sep 03 11:00:58 2010 +0300
@@ -94,7 +94,7 @@
     BLD_INF_RULES.prj_exports += "$$CXENGINE_DIR/data/videoStop.wav    /epoc32/data/z/system/sounds/digital/videoStop.wav"
 }
 
-# confml, crml files
+# confml, crml files, backup registration definition
 symbian {
     CXENGINE_DIR = $$section(PWD,":",1)
     BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>"
@@ -102,6 +102,7 @@
     BLD_INF_RULES.prj_exports += "$$CXENGINE_DIR/conf/camerax_20027017.crml             APP_LAYER_CRML(camerax_20027017.crml)
     BLD_INF_RULES.prj_exports += "$$CXENGINE_DIR/conf/cameraxvariation.confml           APP_LAYER_CONFML(cameraxvariation.confml)
     BLD_INF_RULES.prj_exports += "$$CXENGINE_DIR/conf/cameraxvariation_20027018.crml    APP_LAYER_CRML(cameraxvariation_20027018.crml)
+    BLD_INF_RULES.prj_exports += "$$CXENGINE_DIR/conf/backup_registration.xml           /epoc32/data/z/private/20027017/backup_registration.xml"
 }
 
 
--- a/camerauis/cameraxui/cxengine/inc/api/cxutils.h	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/api/cxutils.h	Fri Sep 03 11:00:58 2010 +0300
@@ -69,7 +69,7 @@
     #define CX_ASSERT_ALWAYS(x)             ASSERT(x)
 #else // !Q_OS_SYMBIAN
     #define CX_ASSERT_ALWAYS(x)             Q_ASSERT(x)
-    #define OstTrace0(x,y,z)    
+    #define OstTrace0(x,y,z)
 #endif // Q_OS_SYMBIAN
 
 #endif // _DEBUG
--- a/camerauis/cameraxui/cxengine/inc/cxestillcapturecontroldesktop.h	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxestillcapturecontroldesktop.h	Fri Sep 03 11:00:58 2010 +0300
@@ -19,6 +19,7 @@
 
 #include <QList>
 #include <QVariant>
+#include <QTimer>
 
 #include "cxestillcapturecontrol.h"
 #include "cxeimagedataqueuedesktop.h"
@@ -91,6 +92,9 @@
     // Autofocus events
     void handleAutofocusStateChanged(CxeAutoFocusControl::State newState, CxeError::Id error);
 
+private slots:
+    void startViewfinder();
+
 private: // helper functions
     void updateFlashSetting(QVariant newValue);
     void updateISOSetting(QVariant newValue);
@@ -117,6 +121,8 @@
     CxeAutoFocusControl::State mAfState;
     QList<CxeStillImageDesktop*> mImages;
     CxeFileSaveThread &mSaveThread;
+
+    QTimer mViewFinderStartTimer;
     
     int mNextSnapshotIndex;
     int mNextImageDataIndex;
--- a/camerauis/cameraxui/cxengine/inc/cxevideocapturecontroldesktop.h	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxevideocapturecontroldesktop.h	Fri Sep 03 11:00:58 2010 +0300
@@ -109,6 +109,7 @@
 
 private slots:
     void handleElapseTimeout();
+    void startViewfinder();
 
 private: // private data
 
@@ -129,6 +130,7 @@
     
     //timer for simulating elapsing time
     QTimer mRecordElapseTimer;
+    QTimer mViewFinderStartTimer;
     
     //elapsed recording time in seconds
     int mElapsedTime;
--- a/camerauis/cameraxui/cxengine/inc/cxeviewfindercontroldesktop.h	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/inc/cxeviewfindercontroldesktop.h	Fri Sep 03 11:00:58 2010 +0300
@@ -25,8 +25,8 @@
 class CxeViewfinderControlDesktop : public CxeViewfinderControl
 {
     Q_OBJECT
+
 public:
-
     CxeViewfinderControlDesktop(CxeCameraDeviceDesktop &cameraDevice);
     virtual ~CxeViewfinderControlDesktop();
 
@@ -41,6 +41,9 @@
     virtual QSize deviceDisplayResolution() const;
 
 private:
+    void createViewfinderWidget();
+
+private:
     State mState;
     WId mWindowId;
     QSize mResolution;
--- a/camerauis/cameraxui/cxengine/src/cxecameradevicedesktop.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxecameradevicedesktop.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -100,6 +100,8 @@
 {
     CX_DEBUG_ENTER_FUNCTION();
     QDir currentDir(".","*.jpg");
+    CX_DEBUG(("Searching images from %s", qPrintable(currentDir.absolutePath())));
+    CX_DEBUG(("Number of images found %d", currentDir.count()));
 
     if (!currentDir.count()) {
         mPictureList.append(QPixmap(360, 640));
--- a/camerauis/cameraxui/cxengine/src/cxegeotaggingtrail_symbian_p.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxegeotaggingtrail_symbian_p.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -29,6 +29,7 @@
 {
     // in milliseconds
     const int STOP_TRAIL_INTERVAL = 10*1000;
+    const int START_TRAIL_ATTEMPTS = 5;
 }
 
 /*!
@@ -89,32 +90,39 @@
     CX_DEBUG_ENTER_FUNCTION();
 
     int err = KErrNone;
+    int retryTrail = START_TRAIL_ATTEMPTS; // In case RLocationTrail::StartLocationTrail() fail, we will retry
     int settingValue = Cxe::GeoTaggingOff;
     settingValue = mSettings.get(CxeSettingIds::GEOTAGGING, settingValue);
     
     if (settingValue == Cxe::GeoTaggingOn) {
-        // geotagging setting is ON, trying to start location trail
-        if (state() == CxeGeoTaggingTrail::NotConnected) {
-            err = mLocationTrail.Connect();
-            if (!err) {
-                CX_DEBUG(("CxeGeoTaggingTrail <> location trail connected"));
-                setState(CxeGeoTaggingTrail::Connected);
+        while(retryTrail) {
+            // geotagging setting is ON, trying to start location trail
+            if (state() == CxeGeoTaggingTrail::NotConnected) {
+                err = mLocationTrail.Connect();
+                if (!err) {
+                    CX_DEBUG(("CxeGeoTaggingTrail <> location trail connected"));
+                    setState(CxeGeoTaggingTrail::Connected);
+                }
+            }
+            // KErrAlreadyExists error means no harm to us
+            if (state() == CxeGeoTaggingTrail::Connected &&
+                (!err || err == KErrAlreadyExists)) {
+                err = mLocationTrail.StartLocationTrail(RLocationTrail::ECaptureAll);
+                if (!err || err == KErrAlreadyExists) {
+                    CX_DEBUG(("CxeGeoTaggingTrail <> starting location trail"));
+                    mStopLocationTrailTimer.stop(); // stop location timer.
+                    setState(CxeGeoTaggingTrail::TrailStarted);
+                }
+            }
+            if (err && err != KErrAlreadyExists) {
+                CX_DEBUG(("CxeGeoTaggingTrailPrivate::start <> FAILED: error = %d . Retries left = %d", err, retryTrail));
+                mLocationTrail.Close();
+                retryTrail--;
+            }
+            else {
+                retryTrail = 0;
             }
         }
-    
-        if (state() == CxeGeoTaggingTrail::Connected && !err) {
-            err = mLocationTrail.StartLocationTrail(RLocationTrail::ECaptureAll);
-            if (!err) {
-                CX_DEBUG(("CxeGeoTaggingTrail <> starting location trail"));
-                mStopLocationTrailTimer.stop(); // stop location timer.
-                setState(CxeGeoTaggingTrail::TrailStarted);
-            }
-        }
-
-        if (err) {
-            CX_DEBUG(("CxeGeoTaggingTrailPrivate::start <> FAILED: error = %d ", err));
-            mLocationTrail.Close();
-        }        
     } else {
         // geotagging setting off, do nothing.
         CX_DEBUG(("CxeGeoTaggingTrail <> start -- Geotagging setting OFF, do nothing.."));
--- a/camerauis/cameraxui/cxengine/src/cxequalitypresetssymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxequalitypresetssymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -184,9 +184,8 @@
         int numLevels = levels->Count();
         for(int i = 0; i < numLevels; i++) {
             mIcm->GetVideoQualitySet(set, levels->At(i), displayId);
-
-            // Disable all video sizes larger than VGA
-            if (set.iCamcorderVisible > 0 && set.iVideoWidth <= 864) {
+          
+            if (set.iCamcorderVisible > 0) {
                 // create new quality preset
                 CxeVideoDetails newPreset = createVideoPreset(set);
 
--- a/camerauis/cameraxui/cxengine/src/cxesoundplayersymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesoundplayersymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -92,8 +92,8 @@
             emit playComplete(KErrNone);
         }
 
-    } else if( state() == NotReady ) {
-        // Here sound loading has failed.
+    } else {
+        // Here sound loading has failed or has not finished yet.
         // Emit signal with error code.
         emit playComplete(KErrNotReady);
     }
--- a/camerauis/cameraxui/cxengine/src/cxestillcapturecontroldesktop.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestillcapturecontroldesktop.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -32,8 +32,11 @@
 #include "cxecameradevicedesktop.h"
 
 // constants
-const int KMaintainAspectRatio = false;
-
+namespace
+{
+    static const int KMaintainAspectRatio = false;
+    static const int VIEWFINDER_START_TIMEOUT = 500; // 0.5 second
+}
 
 
 /**
@@ -62,6 +65,10 @@
     initializeStates();
     reset();
 
+    mViewFinderStartTimer.setSingleShot(true);
+    mViewFinderStartTimer.setInterval(VIEWFINDER_START_TIMEOUT);
+    connect(&mViewFinderStartTimer, SIGNAL(timeout()), this, SLOT(startViewfinder()));
+
     mImageDataQueue = new CxeImageDataQueueDesktop();
 
     CX_DEBUG_EXIT_FUNCTION();
@@ -131,6 +138,10 @@
         CX_DEBUG_EXIT_FUNCTION();
         return;
     }
+
+    mViewFinderStartTimer.stop();
+    mViewfinderControl.stop();
+
     mState = Uninitialized;
     CX_DEBUG_EXIT_FUNCTION();
 }
@@ -173,8 +184,8 @@
     }
 
     if (!err) {
-        // If viewfinder is already running, this call does nothing
-        mViewfinderControl.start();
+        // Start viewfinder with delay.
+        mViewFinderStartTimer.start();
         // inform zoom control to prepare zoom
         emit prepareZoomForStill(ecamStillResolutionIndex);
     } else {
@@ -573,6 +584,17 @@
     CX_DEBUG_EXIT_FUNCTION();
 }
 
+/*!
+* Slot for starting viewfinder after a delay.
+* Delay helps viewfinder widget to find the right, visible transparent window to attach to.
+*/
+void CxeStillCaptureControlDesktop::startViewfinder()
+{
+    CX_DEBUG_ENTER_FUNCTION();
+    mViewfinderControl.start();
+    CX_DEBUG_EXIT_FUNCTION();
+}
+
 
 /*!
 * Returns supported image qualities based on the camera index
--- a/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxestillcapturecontrolsymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -190,9 +190,15 @@
     OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_INIT_IN, "msg: e_CX_STILL_CAPCONT_INIT 1");
 
     if (state() == Uninitialized) {
+        
+        // prepare for still capture.
         prepare();
+
         // Initialize orientation sensor and other sensors
         mSensorEventHandler.init();
+        
+        // inform zoom control to prepare zoom
+        emit prepareZoomForStill(mSizeIndex);
     }
 
     OstTrace0(camerax_performance, CXESTILLCAPTURECONTROLSYMBIAN_INIT_OUT, "msg: e_CX_STILL_CAPCONT_INIT 0");
@@ -285,9 +291,6 @@
         // We can safely set state to READY.
         setState(Ready);
 
-        // inform zoom control to prepare zoom
-        emit prepareZoomForStill(mSizeIndex);
-
     } catch (const std::exception &e) {
         // Exception encountered, free resources.
         CX_DEBUG(("Image Prepare FAILED! symbian error = %d", qt_symbian_exception2Error(e)));
--- a/camerauis/cameraxui/cxengine/src/cxethumbnailmanagersymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxethumbnailmanagersymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -119,6 +119,7 @@
 
     Q_UNUSED(thumbnail);
     Q_UNUSED(data);
+    Q_UNUSED(error);
 
     CX_DEBUG(("CxeThumbnailManagerSymbian::thumbnailReady error = %d", error));
 
--- a/camerauis/cameraxui/cxengine/src/cxevideocapturecontroldesktop.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxevideocapturecontroldesktop.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -30,6 +30,7 @@
 {
     // Unit is milliseconds
     static const int CXENGINE_ELAPSED_TIME_TIMEOUT = 1000; // 1 second
+    static const int VIEWFINDER_START_TIMEOUT      =  500; // 0.5 second
 
     // Unit is seconds
     static const int CXENGINE_MAXIMUM_VIDEO_TIME = 90*60; // 90 minutes
@@ -60,6 +61,11 @@
     qRegisterMetaType<CxeVideoCaptureControl::State> ();
     initializeStates();
     setupElapseTimer();
+
+    mViewFinderStartTimer.setSingleShot(true);
+    mViewFinderStartTimer.setInterval(VIEWFINDER_START_TIMEOUT);
+    connect(&mViewFinderStartTimer, SIGNAL(timeout()), this, SLOT(startViewfinder()));
+
     CX_DEBUG_EXIT_FUNCTION();
 }
 
@@ -108,6 +114,10 @@
         CX_DEBUG_EXIT_FUNCTION();
         return;
     }
+
+    mViewFinderStartTimer.stop();
+    mViewfinderControl.stop();
+
     // stop video-recording in-case if its ongoing.
     stop();
 
@@ -224,7 +234,8 @@
         emit prepareZoomForVideo();
     }
 
-    mViewfinderControl.start();
+    // Start viewfinder with delay.
+    mViewFinderStartTimer.start();
     setState(Ready);
 
     // emit video prepare status
@@ -319,7 +330,7 @@
 * @Return current video snapshot
 */
 QPixmap CxeVideoCaptureControlDesktop::snapshot() const
-{    
+{
     return mSnapshot;
 }
 
@@ -341,7 +352,7 @@
 
     if (state() == Ready || state() == Paused) {
         //we skip the playing of the sound in the desktop state for now
-        setState(Recording);        
+        setState(Recording);
         mRecordElapseTimer.start();
     }
 
@@ -373,14 +384,13 @@
 
     if (state() == Recording || state() == Paused) {
         mFilenameGenerator.raiseCounterValue();
-    }
+
+        mRecordElapseTimer.stop();
+        mElapsedTime = 0;
 
-    mViewfinderControl.stop();
-    mRecordElapseTimer.stop();
-    mElapsedTime = 0;
-
-    setState(Stopping);
-    setState(Initialized);
+        setState(Stopping);
+        setState(Initialized);
+    }
 
     CX_DEBUG_EXIT_FUNCTION();
 }
@@ -541,6 +551,18 @@
     CX_DEBUG( ("CxeVideoCaptureControlDesktop::handleElapseTimeout() <> mElapsedTime: %d", mElapsedTime ) );
 }
 
+/*!
+* Slot for starting viewfinder after a delay.
+* Delay helps viewfinder widget to find the right, visible transparent window to attach to.
+*/
+void CxeVideoCaptureControlDesktop::startViewfinder()
+{
+    CX_DEBUG_ENTER_FUNCTION();
+    mViewfinderControl.start();
+    CX_DEBUG_EXIT_FUNCTION();
+}
+
+
 void CxeVideoCaptureControlDesktop::setState(CxeVideoCaptureControl::State stateId, CxeError::Id error)
 {
     mState = stateId;
--- a/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -159,6 +159,8 @@
     if (state() == Idle) {
         // start initializing resources for video capture
         initVideoRecorder();
+        // inform zoom control to prepare zoom.
+        emit prepareZoomForVideo();
     } else if (state() == Initialized) {
         // video recorder already initalized. Continue to prepare video reocording.
         open();
@@ -329,8 +331,7 @@
         // Settings have been applied successfully, start to prepare.
         mVideoRecorder->prepare();
 
-        // Prepare zoom only when there are no errors during prepare.
-        emit prepareZoomForVideo();
+        // Inform client
         emit videoPrepareComplete(CxeError::None);
     } catch (const std::exception &e) {
         // Handle error.
@@ -444,14 +445,18 @@
 void CxeVideoCaptureControlSymbian::pause()
 {
     CX_DEBUG_ENTER_FUNCTION();
-    try {
-        mVideoRecorder->pause();
-        setState(CxeVideoCaptureControl::Paused);
-        // play the sound, but not changing the state
-        mVideoStopSoundPlayer->play();
-    } catch (const std::exception &e) {
-        handleComposeFailed(qt_symbian_exception2Error(e));
+
+    if (state() == Recording) {
+        try {
+            mVideoRecorder->pause();
+            setState(CxeVideoCaptureControl::Paused);
+            // play the sound, but not changing the state
+            mVideoStopSoundPlayer->play();
+        } catch (const std::exception &e) {
+            handleComposeFailed(qt_symbian_exception2Error(e));
+        }
     }
+
     CX_DEBUG_EXIT_FUNCTION();
 }
 
--- a/camerauis/cameraxui/cxengine/src/cxeviewfindercontroldesktop.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxeviewfindercontroldesktop.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -16,6 +16,7 @@
 */
 
 #include <HbMainWindow>
+#include <HbTransparentWindow>
 #include <HbView>
 #include <HbLabel>
 #include <QGraphicsLinearLayout>
@@ -52,21 +53,9 @@
     if (state() != Running) {
         mState = Ready;
         emit stateChanged(mState, CxeError::None);
-    CX_DEBUG_EXIT_FUNCTION();
     }
 
-
-    HbMainWindow* mainWindow = qobject_cast<HbMainWindow*>(QWidget::find(mWindowId));
-
-    if (mainWindow) {
-        if( !mViewfinderWidget) {
-            mViewfinderWidget = new CxeViewfinderWidgetDesktop();
-            connect(&mCameraDevice, SIGNAL(imageChanged(QPixmap)), mViewfinderWidget, SLOT(handleImageChange(QPixmap)));
-        }
-        HbView* view = mainWindow->currentView();
-        view->scene()->addItem(mViewfinderWidget);
-        mViewfinderWidget->setZValue(-1.0);
-    }
+    CX_DEBUG_EXIT_FUNCTION();
 }
 
 /*!
@@ -76,6 +65,9 @@
 CxeError::Id CxeViewfinderControlDesktop::start()
 {
     CX_DEBUG_ENTER_FUNCTION();
+
+    createViewfinderWidget();
+
     if (mState != Running) {
         mState = Running;
         emit stateChanged(mState, CxeError::None);
@@ -113,4 +105,45 @@
     return mResolution;
 }
 
+/*!
+* Create the viewfinder widget.
+*/
+void CxeViewfinderControlDesktop::createViewfinderWidget()
+{
+    CX_DEBUG_ENTER_FUNCTION();
+    HbMainWindow* mainWindow = qobject_cast<HbMainWindow*>(QWidget::find(mWindowId));
+    if (mainWindow) {
+        CX_DEBUG(("Found main window."));
+        // Remove the current viewfinder from previous view scene.
+        // Ownership is returned, so delete it now.
+        if (mViewfinderWidget) {
+            mViewfinderWidget->setParentItem(0);
+            mainWindow->scene()->removeItem(mViewfinderWidget);
+            delete mViewfinderWidget;
+            mViewfinderWidget = 0;
+        }
+
+        // Find the visible transparent window and place our viewfinder widget as it's child.
+        HbView* view = mainWindow->currentView();
+        const QList<QGraphicsItem *> itemList(view->scene()->items());
+        foreach (QGraphicsItem *item, itemList) {
+            if (item->type() == Hb::ItemType_TransparentWindow) {
+                CX_DEBUG(("Found transparent window, name: %s",
+                          item->toGraphicsObject()
+                          ? qPrintable(item->toGraphicsObject()->objectName())
+                          : qPrintable(QString("<unknown>"))));
+                bool visible(item->isVisible());
+                CX_DEBUG(("Is found transparent window visible: %s", qPrintable(QVariant::fromValue(visible).toString())));
+                if (visible) {
+                    mViewfinderWidget = new CxeViewfinderWidgetDesktop();
+                    connect(&mCameraDevice, SIGNAL(imageChanged(QPixmap)), mViewfinderWidget, SLOT(handleImageChange(QPixmap)));
+                    mViewfinderWidget->setParentItem(item);
+                    break;
+                }
+            }
+        }
+    }
+    CX_DEBUG_EXIT_FUNCTION();
+}
+
 // end of file
--- a/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettings.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -59,7 +59,7 @@
     } else {
         err = CxeError::NotFound;
     }
-    
+
     return err;
     //int variation = mVariationKeyHash[key];
     //value = QVariant(variation);
@@ -96,7 +96,6 @@
 QHash<QString, QVariantList> CxeFakeSettings::loadVariationSettings()
 {
     QHash<QString, QVariantList> settings;
-	CxeError::Id err = CxeError::None;
 	QVariantList list;
 	QVariant data;
 
--- a/camerauis/cameraxui/cxengine/tsrc/unit/system_include/thumbnailmanager_qt.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/system_include/thumbnailmanager_qt.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -54,8 +54,9 @@
 int ThumbnailManager::getThumbnail(const QString& filename, void * clientData, int priority)
 {
     CX_DEBUG_ENTER_FUNCTION();
+    Q_UNUSED(clientData);
     Q_UNUSED(priority);
-        
+
     int id = 0;
 
     if (filename.isNull() || filename.isEmpty()) {
@@ -116,7 +117,7 @@
     // get the current thumbnail id
     int id = mCurrentThumbnailId - 1;
     int status = KErrNone;
-    
+
     if (id == -1) {
         // if there are no valid thumbnails
         status = KErrNotFound;
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevicecontrolsymbian/unittest_cxecameradevicecontrolsymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxecameradevicecontrolsymbian/unittest_cxecameradevicecontrolsymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -26,6 +26,7 @@
 UnitTestCxeCameraDeviceControlSymbian::UnitTestCxeCameraDeviceControlSymbian()
     : mDeviceControl(NULL)
 {
+    qRegisterMetaType<CxeError::Id>("CxeError::Id");
 }
 
 UnitTestCxeCameraDeviceControlSymbian::~UnitTestCxeCameraDeviceControlSymbian()
@@ -80,8 +81,10 @@
 
     mDeviceControl->switchCamera(Cxe::SecondaryCameraIndex);
 
+    // Reserve can last long and we have had hacks with extra delay.
+    // Hence using quite large time out value.
     QVERIFY(CxeTestUtils::waitForState<CxeCameraDeviceControl>(
-            *mDeviceControl, CxeCameraDeviceControl::Ready, 1000));
+            *mDeviceControl, CxeCameraDeviceControl::Ready, 3000));
 
     QVERIFY(mDeviceControl->cameraIndex() == Cxe::SecondaryCameraIndex);
 }
@@ -90,8 +93,9 @@
 {
     mDeviceControl->reserve();
 
+    // Using quite large time out value. See testSwitchCamera() comments.
     QVERIFY(CxeTestUtils::waitForState<CxeCameraDeviceControl>(
-            *mDeviceControl, CxeCameraDeviceControl::Ready, 1000));
+            *mDeviceControl, CxeCameraDeviceControl::Ready, 3000));
 }
 
 // main() function
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefeaturemanagerimp/unittest_cxefeaturemanagerimp.pro	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefeaturemanagerimp/unittest_cxefeaturemanagerimp.pro	Fri Sep 03 11:00:58 2010 +0300
@@ -17,7 +17,8 @@
            cxefeaturemanagerimp.cpp \
            cxesettingsmappersymbian.cpp \
            cxesettingsimp.cpp \
-           cxefakesettings.cpp
+           cxefakesettings.cpp \
+           cxescenemodestore.cpp
 HEADERS *= unittest_cxefeaturemanagerimp.h \
            cxefeaturemanagerimp.h \
            cxeerror.h \
@@ -25,4 +26,6 @@
            cxesettingsmappersymbian.h \
            cxesettings.h \
            cxesettingsimp.h \
-           cxefakesettings.h
+           cxefakesettings.h \
+           cxescenemodestore.h
+           
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilenamegeneratorsymbian/unittest_cxefilenamegeneratorsymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilenamegeneratorsymbian/unittest_cxefilenamegeneratorsymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -43,7 +43,7 @@
 void UnitTestCxeFilenameGeneratorSymbian::init()
 {
     mFakeSettings = new CxeFakeSettings();
-    
+
     mFakeSettings->set(CxeSettingIds::FNAME_MONTH_FOLDER, QDate::currentDate().toString("yyyyMM"));
     mFakeSettings->set(CxeSettingIds::FNAME_IMAGE_COUNTER, 0);
     mFakeSettings->set(CxeSettingIds::FNAME_VIDEO_COUNTER, 0);
@@ -112,6 +112,8 @@
 
 QString UnitTestCxeFilenameGeneratorSymbian::generateSequenceImageFileName(int counter, int burstIndex)
 {
+    Q_UNUSED(burstIndex);
+
     // For now, burst image names are created like normal unique names
     QString filename = generateImageFileName(counter);
     // get the file name suffix
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.pro	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxefilesavethreadsymbian/unittest_cxefilesavethreadsymbian.pro	Fri Sep 03 11:00:58 2010 +0300
@@ -14,8 +14,8 @@
 
 include(../unittest.pri)
 
-INCLUDEPATH *= ../system_include
-DEPENDPATH  *= ../system_include
+INCLUDEPATH = . ../utils ../system_include ../../fakeclasses ../../../traces
+DEPENDPATH  = . ../utils ../system_include ../../fakeclasses ../../../traces
 
 TARGET = unittest_cxefilesavethreadsymbian
 
@@ -23,37 +23,38 @@
 LIBS *= -lplatformenv
 LIBS *= -lefsrv
 LIBS *= -lcone
-LIBS *= -lthumbnailmanagerqt
 
-SOURCES *= unittest_cxefilesavethreadsymbian.cpp \
+SOURCES *= ./unittest_cxefilesavethreadsymbian.cpp \
            thumbnailmanager_qt.cpp \
            harvesterclient.cpp \
-           cxefilesavethread.cpp \
-           cxefilesavethreadsymbian.cpp \
+           ../../../src/cxefilesavethread.cpp \
+           ../../../src/cxefilesavethreadsymbian.cpp \
            cxefakeimagedataitem.cpp \
-           cxeimagedataitemsymbian.cpp \
-           cxeharvestercontrolsymbian.cpp \
-           cxethumbnailmanagersymbian.cpp \
-           cxesysutil.cpp \
-           cxestatemachinebase.cpp \
-           cxestatemachine.cpp \
-           cxestate.cpp \
-           cxeerrormappingsymbian.cpp
+           ../../../src/cxeimagedataitemsymbian.cpp \
+           ../../../src/cxeharvestercontrolsymbian.cpp \
+           ../../../src/cxethumbnailmanagersymbian.cpp \
+           ../../../src/cxesysutil.cpp \
+           ../../../src/cxestatemachinebase.cpp \
+           ../../../src/cxestatemachine.cpp \
+           ../../../src/cxestate.cpp \
+           cxetestutils.cpp \
+           ../../../src/cxeerrormappingsymbian.cpp
 
-HEADERS *= unittest_cxefilesavethreadsymbian.h \
+HEADERS *= ./unittest_cxefilesavethreadsymbian.h \
            thumbnailmanager_qt.h \
            harvesterclient.h \
-           cxefilesavethread.h \
-           cxefilesavethreadsymbian.h \
+           ../../../inc/cxefilesavethread.h \
+           ../../../inc/cxefilesavethreadsymbian.h \
            cxefakeimagedataitem.h \
-           cxeimagedataitemsymbian.h \
-           cxeimagedataitem.h \
-           cxeerror.h \
-           cxeharvestercontrolsymbian.h \
-           cxethumbnailmanagersymbian.h \
-           cxesysutil.h \
-           cxestatemachinebase.h \
-           cxestatemachine.h \
-           cxestate.h \
-           cxeerrormappingsymbian.h
+           ../../../inc/cxeimagedataitemsymbian.h \
+           ../../../inc/api/cxeimagedataitem.h \
+           ../../../inc/api/cxeerror.h \
+           ../../../inc/cxeharvestercontrolsymbian.h \
+           ../../../inc/cxethumbnailmanagersymbian.h \
+           ../../../inc/cxesysutil.h \
+           ../../../inc/cxestatemachinebase.h \
+           ../../../inc/cxestatemachine.h \
+           ../../../inc/cxestate.h \
+           cxetestutils.h \
+           ../../../inc/cxeerrormappingsymbian.h
 
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxememorymonitor/unittest_cxememorymonitor.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxememorymonitor/unittest_cxememorymonitor.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -25,8 +25,8 @@
 #include "unittest_cxememorymonitor.h"
 
 UnitTestCxeMemoryMonitor::UnitTestCxeMemoryMonitor()
-    : mMemoryMonitor(NULL),
-      mFakeFeatureManager(NULL)
+    : mFakeFeatureManager(NULL),
+      mMemoryMonitor(NULL)
 {
 }
 
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxesettingsimp/unittest_cxesettingsimp.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -27,14 +27,13 @@
 
 const char* FAIL_TEST_SETTING = "Fail test";
 const char* EMPTY_STRING = "";
-const int CAMERA_MODE_STILL = 0;
-const int CAMERA_MODE_VIDEO = 1;
 //Default EV compensation value for auto still and auto video scene mode
 const int SCENE_AUTO_EV_VALUE = 0;
 const int SIGNAL_TIMEOUT = 3000; //milliseconds
 
-UnitTestCxeSettingsImp::UnitTestCxeSettingsImp() :
-        mSettingsImp(NULL), mSettingsStore(NULL)
+UnitTestCxeSettingsImp::UnitTestCxeSettingsImp()
+    : mSettingsStore(NULL),
+      mSettingsImp(NULL)
 {
     qRegisterMetaType<CxeScene>("CxeScene");
     qRegisterMetaType<CxeError::Id>("CxeError::Id");
@@ -130,7 +129,6 @@
 void UnitTestCxeSettingsImp::testGet()
 {
     CX_DEBUG_ENTER_FUNCTION();
-    CxeError::Id err = CxeError::None;
 
     // The idea of this test case is to test as much of different type of settings
     // as possible
@@ -146,7 +144,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
 
     mSettingsStore->get(CxeSettingIds::BRIGHTNESS, testValue);
@@ -161,7 +158,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
 
     QVariant colorTone2;
@@ -177,7 +173,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
 
     mSettingsStore->get(CxeSettingIds::CONTRAST, testValue);
@@ -192,7 +187,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
 
     mSettingsStore->get(CxeSettingIds::FNAME_FOLDER_SUFFIX, testValue);
@@ -211,7 +205,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
 
     QCOMPARE(sceneData[CxeSettingIds::EV_COMPENSATION_VALUE].toInt(), SCENE_AUTO_EV_VALUE);
@@ -226,7 +219,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
 
     QCOMPARE(sceneData[CxeSettingIds::EV_COMPENSATION_VALUE].toInt(), SCENE_AUTO_EV_VALUE);
@@ -332,7 +324,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
     mSettingsStore->get(CxeSettingIds::COLOR_TONE, value);
     QCOMPARE(value.toInt(), (int)Cxe::ColortoneBlackAndWhite);
@@ -346,7 +337,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
     mSettingsStore->get(CxeSettingIds::FNAME_FOLDER_SUFFIX, value);
     QCOMPARE(value.toString(), stringValue);
@@ -360,7 +350,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
     mSettingsStore->get(CxeSettingIds::STILL_SHOWCAPTURED, value);
     QCOMPARE(value.toBool(), boolValue);
@@ -374,7 +363,6 @@
         QString message = "Exception thrown, error id = ";
         message.append(exception.error());
         QFAIL(message.toAscii());
-        return;
     }
     mSettingsStore->get(CxeSettingIds::EV_COMPENSATION_VALUE, value);
     QCOMPARE(value.toReal(), qrealValue);
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -23,8 +23,6 @@
 #include "cxutils.h"
 #include "cxetestutils.h"
 
-const int SIGNAL_TIMEOUT = 3000; //milliseconds
-
 
 UnitTestCxeThumbnailManagerSymbian::UnitTestCxeThumbnailManagerSymbian()
 {
@@ -52,36 +50,11 @@
 {
     CX_DEBUG_ENTER_FUNCTION();
 
-    QSignalSpy thumbnailReadySpy(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)));
-    QString filename;
-
-    QVERIFY(thumbnailReadySpy.isValid()); 
-
-    // case 1: testing with wrong dummy file, we should get an error code with thumbnailready
-    // since filename is invalid
-    // DISABLE FOR NOW
-    // TODO: Create a fake implementation for the thumbnailmanager
-    // what is used by cxethumbnailmanagersymbian.
-    //mThumbnailManager->createThumbnail(filename, QImage());
-
-    // we should not get any call back when we have invalid file name.
-    //QCOMPARE(thumbnailReadySpy.count(), 0);
+    // case 1: Testing with wrong dummy file. Check only that call is made successfully.
+    mThumbnailManager->createThumbnail(QString(""), QImage());
 
-
-    // case 1: testing with proper file name, we shouldnt get an error code with thumbnailready
-    // since filename is valid
-    filename = QString("c:\\test.jpg");    
-    mThumbnailManager->createThumbnail(filename, QImage());
-
-    QVERIFY(CxeTestUtils::waitForSignal(thumbnailReadySpy, SIGNAL_TIMEOUT));
-
- 
-    //QCOMPARE( thumbnailReadySpy.count(), 1 );
-    if (thumbnailReadySpy.count() > 0) {
-        QList<QVariant> initModeArguments = thumbnailReadySpy.takeFirst();
-        // we are only interested in error code in this case 1
-        QCOMPARE(initModeArguments.at(1).toInt(), KErrNone);
-    }
+    // case 2: Testing with proper file name.
+    mThumbnailManager->createThumbnail(QString("C:\\test.jpg"), QImage());
 
     CX_DEBUG_EXIT_FUNCTION();
 }
@@ -91,8 +64,17 @@
 {
     CX_DEBUG_ENTER_FUNCTION();
 
+    // case 1: Cancel with empty string.
+    mThumbnailManager->cancelThumbnail(QString());
+
+    // case 2: Cancel non-existent file / request.
     mThumbnailManager->cancelThumbnail(QString("filename"));
 
+    // case 3: Cancel actual request.
+    QString file("C:\\test2.jpg");
+    mThumbnailManager->createThumbnail(file, QImage());
+    mThumbnailManager->cancelThumbnail(file);
+
     CX_DEBUG_EXIT_FUNCTION();
 }
 
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.pro	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxethumbnailmanagersymbian/unittest_cxethumbnailmanagersymbian.pro	Fri Sep 03 11:00:58 2010 +0300
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of "Eclipse Public License v1.0"
@@ -15,16 +15,15 @@
 
 TARGET = unittest_cxethumbnailmanagersymbian
 
-INCLUDEPATH *= ../system_include
-DEPENDPATH  *= ../system_include
-
-LIBS *= -lthumbnailmanagerqt
+# Override include paths so that our stub implementation of system classes is used.
+DEPENDPATH  = . ../system_include ../utils
+INCLUDEPATH = . ../system_include ../utils
 
 HEADERS *= unittest_cxethumbnailmanagersymbian.h \
-           cxethumbnailmanagersymbian.h \
+           ../../../inc/cxethumbnailmanagersymbian.h \
            thumbnailmanager_qt.h \
-           cxutils.h
+           ../../../inc/api/cxutils.h
 
 SOURCES *= unittest_cxethumbnailmanagersymbian.cpp \
            thumbnailmanager_qt.cpp \
-           cxethumbnailmanagersymbian.cpp
+           ../../../src/cxethumbnailmanagersymbian.cpp
--- a/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/unittest_cxevideocapturecontrolsymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -138,7 +138,9 @@
 
     doPrepareStuff();
     QCOMPARE(mCxeVideoCaptureControlSymbian->state(), CxeVideoCaptureControl::Ready);
+
     mCxeVideoCaptureControlSymbian->record();
+    QTest::qWait(1000); // Wait for recording to start.
     QCOMPARE(mCxeVideoCaptureControlSymbian->state(), CxeVideoCaptureControl::Recording);
 
     CX_DEBUG_EXIT_FUNCTION();
@@ -150,6 +152,7 @@
 
     doPrepareStuff();
     mCxeVideoCaptureControlSymbian->record();
+    QTest::qWait(1000); // Wait for recording to start.
     mCxeVideoCaptureControlSymbian->pause();
     QCOMPARE(mCxeVideoCaptureControlSymbian->state(), CxeVideoCaptureControl::Paused);
 
@@ -162,6 +165,7 @@
 
     doPrepareStuff();
     mCxeVideoCaptureControlSymbian->record();
+    QTest::qWait(1000); // Wait for recording to start.
     mCxeVideoCaptureControlSymbian->stop();
     QVERIFY((mCxeVideoCaptureControlSymbian->state() == CxeVideoCaptureControl::Stopping)
         || (mCxeVideoCaptureControlSymbian->state() == CxeVideoCaptureControl::Initialized)
@@ -200,7 +204,7 @@
 
     doPrepareStuff();
     mCxeVideoCaptureControlSymbian->record();
-    QTest::qWait(1000);
+    QTest::qWait(2000);
     mCxeVideoCaptureControlSymbian->stop();
     // just call to see if it doesn't crash
     mCxeVideoCaptureControlSymbian->reset();
--- a/camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h	Fri Sep 03 11:00:58 2010 +0300
@@ -142,6 +142,7 @@
 private slots:
     void disableGeotaggingDisclaimer();
     void launchGeoTaggingSetting();
+    void blinkGeoTaggingIcon();
 
 protected:
     void toggleControls();
@@ -185,6 +186,7 @@
 
     HbAction *mSettingsDialogOkAction;
     HbAction *mSliderSettingsDialogOkAction;
+    QTimer *mGeoTaggingBlinkTimer; // for blinking geotagging icon
 };
 
 #endif // CXUIPRECAPTUREVIEW_H
--- a/camerauis/cameraxui/cxui/inc/cxuistillprecaptureview.h	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuistillprecaptureview.h	Fri Sep 03 11:00:58 2010 +0300
@@ -109,6 +109,7 @@
     void updateQualityIcon();
     void closeDialogs();
     void updateFaceTrackingIcon();
+    void updateGeotaggingIcon();
 
 private:
     void reloadIndicatorWidgets();
--- a/camerauis/cameraxui/cxui/layouts/image_setting.xml	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/layouts/image_setting.xml	Fri Sep 03 11:00:58 2010 +0300
@@ -92,7 +92,7 @@
                       preview="0"
                       type="SingleLineListBox"
                       setting_icon="">
-            <item string="txt_cam_list_geotagging_on"   value="1" icon="" />
+            <item string="txt_cam_list_geotagging_on"   value="1" icon="qtg_mono_geotag" />
             <item string="txt_cam_list_geotagging_off"    value="0" icon="" />
         </setting_list>
 
--- a/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -72,6 +72,8 @@
 using namespace CxUiSettings;
 using namespace CxUiInternal;
 
+const int CXUI_GEOTAGGING_BLINK_INTERVAL = 500; //milliseconds, for geotagging icon
+
 
 // ---------------------------------------------------------------------------
 // CxuiPrecaptureView::CxuiPrecaptureView
@@ -156,6 +158,9 @@
     mHideControlsTimeout.setSingleShot(true);
     mHideControlsTimeout.setInterval(CXUI_HIDE_CONTROLS_TIMEOUT);
 
+    mGeoTaggingBlinkTimer = new QTimer(this);
+    connect(mGeoTaggingBlinkTimer, SIGNAL(timeout()), this, SLOT(blinkGeoTaggingIcon()));
+
     hideControls();
 
     if (CxuiServiceProvider::isCameraEmbedded()) {
@@ -888,21 +893,43 @@
 void CxuiPrecaptureView::updateLocationIndicator(CxeGeoTaggingTrail::State newState, CxeError::Id error)
 {
     CX_DEBUG( ("CxuiPrecaptureView::updateLocationIndicator <> error: %d ", error));
-
-    if (mGeoTaggingIndicatorIcon) {
+    Cxe::GeoTagging currentValue = mEngine->settings().get<Cxe::GeoTagging>(CxeSettingIds::GEOTAGGING);
+    if(currentValue == Cxe::GeoTaggingOn && mGeoTaggingIndicatorIcon) {
         if (newState == CxeGeoTaggingTrail::DataAvailable && error == CxeError::None) {
             CX_DEBUG(("CxuiPrecaptureView::updateLocationIndicator GPS data available, showing icon"));
-            mGeoTaggingIndicatorIcon->setIcon(HbIcon("qtg_mono_geotag"));
             mGeoTaggingIndicatorIcon->show();
+            mGeoTaggingBlinkTimer->stop();
         } else {
-            CX_DEBUG(("CxuiPrecaptureView::handleIconChanged GPS data not available"));
-            mGeoTaggingIndicatorIcon->hide();
+            // blinking geotagging indicator while acquiring GPS data
+            CX_DEBUG(("CxuiPrecaptureView::updateLocationIndicator waiting for GPS data, blinking icon"));
+            mGeoTaggingBlinkTimer->setInterval(CXUI_GEOTAGGING_BLINK_INTERVAL);
+            mGeoTaggingBlinkTimer->start();
         }
     }
+    else {
+        CX_DEBUG(("CxuiPrecaptureView::handleIconChanged GPS data not available"));
+        mGeoTaggingBlinkTimer->stop();
+    }
 
     CX_DEBUG_EXIT_FUNCTION();
 }
 
+/*!
+ * Private method for blinking geotagging icon
+ */
+void CxuiPrecaptureView::blinkGeoTaggingIcon()
+{
+    if (mGeoTaggingIndicatorIcon) {
+        if (mGeoTaggingIndicatorIcon->isVisible()) {
+            mGeoTaggingIndicatorIcon->setVisible(false);
+        } else {
+            mGeoTaggingIndicatorIcon->setVisible(true);
+        }
+    }
+}
+
+void CxuiPrecaptureView::toolbarExtensionAppearEffectFinished(const HbEffect::EffectStatus &status) {
+}
 
 void CxuiPrecaptureView::toolbarExtensionDisappearEffectFinished(const HbEffect::EffectStatus &status) {
     if (mSettingsGrid) {
@@ -910,11 +937,6 @@
     }
 }
 
-void CxuiPrecaptureView::toolbarExtensionAppearEffectFinished(const HbEffect::EffectStatus &status) {
-}
-
-
-
 /*!
 * Lauches "Geotagging first-time use" notification to the user
 */
--- a/camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -194,11 +194,18 @@
     QVariantMap data;
     QVariantHash params;
 
-    //@todo: add pre-capture icon as screenshot
     if (mEngine->mode() == Cxe::ImageMode) {
+        HbIcon activityScreenshot("qtg_graf_taskswitcher_camera");
+        QPixmap screenshot = activityScreenshot.pixmap();
+        params.insert("screenshot", screenshot);
+
         mActivityManager->removeActivity(CxuiActivityIds::STILL_PRECAPTURE_ACTIVITY);
         mActivityManager->addActivity(CxuiActivityIds::STILL_PRECAPTURE_ACTIVITY, data, params);
     } else {
+        HbIcon activityScreenshot("qtg_graf_taskswitcher_camcorder");
+        QPixmap screenshot = activityScreenshot.pixmap();
+        params.insert("screenshot", screenshot);
+
         mActivityManager->removeActivity(CxuiActivityIds::VIDEO_PRECAPTURE_ACTIVITY);
         mActivityManager->addActivity(CxuiActivityIds::VIDEO_PRECAPTURE_ACTIVITY, data, params);
     }
--- a/camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlistmodel.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlistmodel.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -117,6 +117,17 @@
 {
     CX_DEBUG_ENTER_FUNCTION();
     mItems = items;
+
+    // Notify radio button list that the data content has changed.
+    if (mItems.size() > 0) {
+        const QModelIndex start = index(0, 0);
+        const QModelIndex end = index(mItems.size() - 1, 0);
+        emit dataChanged(start, end);
+    }
+
+    // Relayouting needed.
+    emit layoutChanged();
+
     CX_DEBUG_EXIT_FUNCTION();
 }
 
--- a/camerauis/cameraxui/cxui/src/cxuisettingsinfo.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuisettingsinfo.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -238,7 +238,7 @@
             qualityIcon = "qtg_mono_12mp";
         } else if (quality.mMpxCount == "9") {
             qualityIcon = "qtg_mono_9mp";
-        } else if (quality.mMpxCount == "3") {
+        } else if (quality.mMpxCount == "3.1") {
             qualityIcon = "qtg_mono_3mp";
         } else if (quality.mMpxCount == "1.2") {
             qualityIcon = "qtg_mono_1_3mp";
--- a/camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -157,6 +157,10 @@
     CX_DEBUG_ENTER_FUNCTION();
     CX_ASSERT_ALWAYS(mDocumentLoader);
 
+    // delete old indicator container and indicators before creating new ones
+    delete mIndicators;
+    mIndicators = NULL;
+
     bool ok = false;
     mDocumentLoader->load(STILL_1ST_XML, STILL_PRE_CAPTURE_INDICATORS_SECTION, &ok);
     CX_ASSERT_ALWAYS(ok);
@@ -224,7 +228,12 @@
 
     // create background for indicator container
     createWidgetBackgroundGraphic(mIndicators, TRANSPARENT_BACKGROUND_GRAPHIC);
-
+    
+    // Update the icons that are possibly changed during reloading
+    updateQualityIcon();
+    updateFaceTrackingIcon();
+    updateGeotaggingIcon();
+                
     mIndicators->setVisible(true);
 
     CX_DEBUG_EXIT_FUNCTION();
@@ -652,16 +661,13 @@
     switch (newstate) {
     case CxeAutoFocusControl::Failed:
     case CxeAutoFocusControl::Ready:
+    case CxeAutoFocusControl::Unknown:
         if (mCapturePending) {
             // focus and capture were grouped together, capture straight away
-            capture();
-        }
-        break;
-    case CxeAutoFocusControl::Unknown:
-        // Capture key was pressed, focus has been cancelled,
-        // continue with capturing.
-        if(mCapturePending) {
             CX_DEBUG(("mCapturePending is true, starting capture now"));
+            OstTrace0(camerax_performance, CXUISTILLPRECAPTUREVIEW_SHOT_TO_SHOT2, "msg: e_CX_SHOT_TO_SHOT 1");
+            OstTrace0(camerax_performance, CXUISTILLPRECAPTUREVIEW_SHOT_TO_SNAP2, "msg: e_CX_SHOT_TO_SNAPSHOT 1");
+            OstTrace0(camerax_performance, CXUISTILLPRECAPTUREVIEW_SHOT_TO_SAVE2, "msg: e_CX_SHOT_TO_SAVE 1");
             capture();
         }
         break;
@@ -775,6 +781,8 @@
     updateImagesLeftLabel();
     updateQualityIcon();
     updateFaceTrackingIcon();
+    updateGeotaggingIcon();
+
 
     // cancel selftimer when returning to precapture
     // since selftimer needs to be turned off after capturing an image
@@ -924,22 +932,18 @@
 
     \sa CxuiStillPrecaptureView::handleSceneChanged(CxeScene &scene)
  */
-void CxuiStillPrecaptureView::handleSettingValueChanged(const QString& key, QVariant newValue)
+void CxuiStillPrecaptureView::handleSettingValueChanged(const QString &key, QVariant newValue)
 {
     CX_DEBUG_ENTER_FUNCTION();
 
     if (mEngine->mode() == Cxe::ImageMode) {
-
         // update images left and image quality icons
         if (key == CxeSettingIds::IMAGE_QUALITY) {
-            // update the quality indicator on screen
-            updateQualityIcon();
+            reloadIndicatorWidgets();
             // update images left when quality values are changed
             updateImagesLeftLabel();
-        } else if (key == CxeSettingIds::FACE_TRACKING) {
-            reloadIndicatorWidgets();
-            updateFaceTrackingIcon();
-        } else if (key == CxeSettingIds::GEOTAGGING) {
+        } else if (key == CxeSettingIds::FACE_TRACKING ||
+                   key == CxeSettingIds::GEOTAGGING) {
             reloadIndicatorWidgets();
         }
 
@@ -1048,4 +1052,25 @@
     CX_DEBUG_EXIT_FUNCTION();
 }
 
+/*!
+    Update the geotagging icon
+*/
+void CxuiStillPrecaptureView::updateGeotaggingIcon()
+{
+    CX_DEBUG_ENTER_FUNCTION();
+    if (mGeoTaggingIndicatorIcon && mEngine) {
+        QString key = "";
+        QString icon = "";
+
+        key = CxeSettingIds::GEOTAGGING;
+
+        int currentValue = mEngine->settings().get<int>(key, -1);
+        icon = getSettingItemIcon(key, currentValue);
+
+        mGeoTaggingIndicatorIcon->setIcon(HbIcon(icon));
+        mGeoTaggingIndicatorIcon->setVisible(true);
+    }
+    CX_DEBUG_EXIT_FUNCTION();
+}
+
 // end of file
--- a/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuivideoprecaptureview.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -33,6 +33,7 @@
 #include <hbfeedbacksettings.h>
 #include <hbfeedbacknamespace.h>
 #include <hbactivitymanager.h>
+#include <hbextendedlocale.h>
 
 #include "cxuivideoprecaptureview.h"
 #include "cxeengine.h"
@@ -68,8 +69,6 @@
     static const int CXUI_RECORD_ANIMATION_DURATION = 3000; // milliseconds
     static const int CXUI_PAUSE_TIMEOUT = 60*1000;   // 60 seconds
 
-    //!@todo Localization?
-    static const char* VIDEO_TIME_FORMAT = "%02d:%02d";
     const int POSTCAPTURE_ON = -1;
 }
 
@@ -715,14 +714,41 @@
                                            int elapsedTime,
                                            int remainingTime)
 {
-    // Convert time (seconds) into mm:ss
-    // HbExtendedLocale wraps minutes at 60 so we can't use that.
-    // We need to show times over 1 hour, e.g. "90:00".
-    QString elapsed, remaining;
-    elapsed.sprintf(VIDEO_TIME_FORMAT, elapsedTime/60, elapsedTime%60);
-    remaining.sprintf(VIDEO_TIME_FORMAT, remainingTime/60, remainingTime%60);
+    QString elapsed;
+    QString remaining;
+    QString number;
+
+    // Convert time (seconds) into mm:ss in localised form
+    // Since we need to show also times over 1 hour (upto "90:00")
+    // we cannot use time to string conversions directly
+
+    HbExtendedLocale locale = HbExtendedLocale::system();
 
-    label->setPlainText(hbTrId("txt_cam_info_redorcding_time").arg(elapsed).arg(remaining));
+    number = locale.toString(elapsedTime/60);
+    if (number.length() <= 1) {
+        number.prepend(locale.zeroDigit());
+    }
+    elapsed.append(number);
+    elapsed.append(locale.timeSeparator(2));
+    number = locale.toString(elapsedTime%60);
+    if (number.length() <= 1) {
+        number.prepend(locale.zeroDigit());
+    }
+    elapsed.append(number);
+
+    number = locale.toString(remainingTime/60);
+    if (number.length() <= 1) {
+        number.prepend(locale.zeroDigit());
+    }
+    remaining.append(number);
+    remaining.append(locale.timeSeparator(2));
+    number = locale.toString(remainingTime%60);
+    if (number.length() <= 1) {
+        number.prepend(locale.zeroDigit());
+    }
+    remaining.append(number);
+
+    label->setPlainText(hbTrId("txt_cam_info_recording_time").arg(elapsed).arg(remaining));
 }
 
 bool CxuiVideoPrecaptureView::getElapsedTime()
--- a/camerauis/cameraxui/cxui/src/cxuiview.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiview.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -435,8 +435,7 @@
  */
 void CxuiView::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
-    //! @todo temporary workaround for title bar mouse event handling bug
-    if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70 &&
+    if (event->type() == QEvent::GraphicsSceneMousePress && 
         isFeedbackEnabled()) {
         mControlsFeedback.setModalities(HbFeedback::All);
         mControlsFeedback.play();
@@ -451,8 +450,7 @@
  */
 void CxuiView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
-    //! @todo temporary workaround for title bar mouse event handling bug
-    if (event->type() == QEvent::GraphicsSceneMouseRelease && event->scenePos().y() > 70 &&
+    if (event->type() == QEvent::GraphicsSceneMouseRelease && 
         isFeedbackEnabled()) {        
         mControlsFeedback.setModalities(HbFeedback::Tactile);
         mControlsFeedback.play();
@@ -461,13 +459,15 @@
     }
 }
 
-void CxuiView::zoomDisappearEffectFinished(const HbEffect::EffectStatus &status) {
+void CxuiView::zoomDisappearEffectFinished(const HbEffect::EffectStatus &status) 
+{
     if (mSlider) {
         mSlider->hide();
     }
 }
 
-void CxuiView::zoomAppearEffectFinished(const HbEffect::EffectStatus &status) {
+void CxuiView::zoomAppearEffectFinished(const HbEffect::EffectStatus &status) 
+{
 }
 
 // End of file
--- a/camerauis/cameraxui/rom/camerax.iby	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/rom/camerax.iby	Fri Sep 03 11:00:58 2010 +0300
@@ -41,4 +41,7 @@
 // Stub sis for update support
 data = DATAZ_\system\install\camerax_stub.sis    \system\install\camerax_stub.sis
 
+// register for backup/restore of settings.
+data = DATAZ_\private\20027017\backup_registration.xml  private\20027017\backup_registration.xml
+
 #endif // CAMERAX_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Fri Sep 03 11:00:58 2010 +0300
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0" xmlns:qt="http://www.nokia.com/qt">
+ <package id="camera" name="Camera Apps">
+  <collection id="camerauis" name="Camera UIs">
+   <component id="cameraxui" filter="s60" name="CameraX UIs">
+     <meta rel="testbuild">
+       <group name="camera_unit_tests"/>
+     </meta>
+     <unit bldFile="camerauis/cameraxui" qt:proFile="camerax.pro" filter="!test"/>
+     <unit bldFile="camerauis/cameraxui/cxengine/tsrc/unit"  qt:proFile="unit.pro"  filter="test,unit_test"/>
+     </component>
+  </collection>
+ </package>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Fri Sep 03 11:00:58 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="app"/>