diff -r aa5a574040a4 -r a3cc46f37772 harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp --- a/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp Tue Jul 06 14:44:37 2010 +0300 +++ b/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp Fri Sep 17 16:54:49 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,9 +259,23 @@ 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 + // if object does not exists, or data is not modified, find next else if ( err == KErrNotFound || err == KErrAbort ) { if ( err == KErrAbort && mdeObjectId != KNoId ) @@ -400,6 +423,7 @@ if( error != KErrNone || entry.iModified == time ) { + WRITELOG( "CImageComposerAO::GetObjectFromMdeL() - image data has not been modified - abort" ); User::Leave( KErrAbort ); } } @@ -746,8 +770,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 );