harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp
branchRCL_3
changeset 47 b73252188534
parent 15 3cebc1a84278
child 49 f23c07ec56e2
--- a/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp	Thu Jul 15 19:07:24 2010 +0300
+++ b/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp	Thu Aug 19 10:20:41 2010 +0300
@@ -71,16 +71,20 @@
     if ( iMdeObject )
         {
         delete iMdeObject;
+        iMdeObject = NULL;
         }
     if ( iExifUtil )
     	{
     	delete iExifUtil;
+    	iExifUtil = NULL;
     	}
 
     delete iRelationQuery;
+    iRelationQuery = NULL;
     iFs.Close();
     
     delete iMdEHarvesterSession;
+    iMdEHarvesterSession = NULL;
     }
 
 // ---------------------------------------------------------------------------
@@ -110,6 +114,7 @@
     CActiveScheduler::Add( this );
     
     iExifUtil = CHarvesterExifUtil::NewL();
+    iFastModeEnabled = EFalse;
     User::LeaveIfError( iFs.Connect() );
     }
     
@@ -241,6 +246,10 @@
             if( iItemQueue.Count() <= 0 )
             	{
                 iItemQueue.Compress();
+                if( iFastModeEnabled )
+                    {
+                    SetPriority( KHarvesterPriorityComposerPlugin );
+                    }
             	SetNextRequest( ERequestReady );
             	}
             else
@@ -250,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
@@ -746,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 );