harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp
changeset 43 c5e73110f733
parent 40 910a23996aa0
child 48 1389872e7c51
--- a/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -114,6 +114,7 @@
     CActiveScheduler::Add( this );
     
     iExifUtil = CHarvesterExifUtil::NewL();
+    iFastModeEnabled = EFalse;
     User::LeaveIfError( iFs.Connect() );
     }
     
@@ -245,6 +246,10 @@
             if( iItemQueue.Count() <= 0 )
             	{
                 iItemQueue.Compress();
+                if( iFastModeEnabled )
+                    {
+                    SetPriority( KHarvesterPriorityComposerPlugin );
+                    }
             	SetNextRequest( ERequestReady );
             	}
             else
@@ -254,6 +259,20 @@
 	            
 	            if ( err == KErrNone )
 	                {    
+	                CMdEProperty* prop = NULL;
+	                CMdEPropertyDef& originPropDef = iMdeObject->Def().GetPropertyDefL( Object::KOriginProperty );
+	                iMdeObject->Property( originPropDef, prop );
+	                if( prop && prop->Uint8ValueL() == MdeConstants::Object::ECamera && !iFastModeEnabled )
+	                    {
+	                    iFastModeEnabled = ETrue;
+	                    SetPriority( KHarvesterPriorityMonitorPlugin );
+	                    }
+	                else if( iFastModeEnabled )
+	                    {
+	                    iFastModeEnabled = EFalse;
+	                    SetPriority( KHarvesterPriorityComposerPlugin );
+	                    }
+	                
 	                SetNextRequest( ERequestCompose );
 	                }
 	            // if object does not exists, find next
@@ -750,8 +769,13 @@
 
     // Check whether the file is open
     TBool isOpen( EFalse );
-    iFs.IsFileOpen( uri, isOpen );
-    if ( isOpen )
+    const TInt openError = iFs.IsFileOpen( uri, isOpen );
+    if( openError != KErrNone )
+        {
+        WRITELOG( "CImageComposerAO::DoWriteExifL() - check for open file failed!" );
+        User::Leave( openError );
+        }
+    else if ( isOpen )
         {
         WRITELOG( "CImageComposerAO::DoWriteExifL() - file handle is open!" );
         User::Leave( KErrInUse );