69 iNextItemsSkip.Close(); |
69 iNextItemsSkip.Close(); |
70 |
70 |
71 if ( iMdeObject ) |
71 if ( iMdeObject ) |
72 { |
72 { |
73 delete iMdeObject; |
73 delete iMdeObject; |
74 iMdeObject = NULL; |
|
75 } |
74 } |
76 if ( iExifUtil ) |
75 if ( iExifUtil ) |
77 { |
76 { |
78 delete iExifUtil; |
77 delete iExifUtil; |
79 iExifUtil = NULL; |
|
80 } |
78 } |
81 |
79 |
82 delete iRelationQuery; |
80 delete iRelationQuery; |
83 iRelationQuery = NULL; |
|
84 iFs.Close(); |
81 iFs.Close(); |
85 |
82 |
86 delete iMdEHarvesterSession; |
83 delete iMdEHarvesterSession; |
87 iMdEHarvesterSession = NULL; |
|
88 } |
84 } |
89 |
85 |
90 // --------------------------------------------------------------------------- |
86 // --------------------------------------------------------------------------- |
91 // CComposerImagePlugin |
87 // CComposerImagePlugin |
92 // --------------------------------------------------------------------------- |
88 // --------------------------------------------------------------------------- |
112 iLocationObjectDef = NULL; |
108 iLocationObjectDef = NULL; |
113 |
109 |
114 CActiveScheduler::Add( this ); |
110 CActiveScheduler::Add( this ); |
115 |
111 |
116 iExifUtil = CHarvesterExifUtil::NewL(); |
112 iExifUtil = CHarvesterExifUtil::NewL(); |
117 iFastModeEnabled = EFalse; |
|
118 User::LeaveIfError( iFs.Connect() ); |
113 User::LeaveIfError( iFs.Connect() ); |
119 } |
114 } |
120 |
115 |
121 // --------------------------------------------------------------------------- |
116 // --------------------------------------------------------------------------- |
122 // DoCancel |
117 // DoCancel |
244 case ERequestGetObject: |
239 case ERequestGetObject: |
245 { |
240 { |
246 if( iItemQueue.Count() <= 0 ) |
241 if( iItemQueue.Count() <= 0 ) |
247 { |
242 { |
248 iItemQueue.Compress(); |
243 iItemQueue.Compress(); |
249 if( iFastModeEnabled ) |
|
250 { |
|
251 SetPriority( KHarvesterPriorityComposerPlugin ); |
|
252 } |
|
253 SetNextRequest( ERequestReady ); |
244 SetNextRequest( ERequestReady ); |
254 } |
245 } |
255 else |
246 else |
256 { |
247 { |
257 TItemId mdeObjectId = KNoId; |
248 TItemId mdeObjectId = KNoId; |
258 TRAPD( err, GetObjectFromMdeL( mdeObjectId ) ); |
249 TRAPD( err, GetObjectFromMdeL( mdeObjectId ) ); |
259 |
250 |
260 if ( err == KErrNone ) |
251 if ( err == KErrNone ) |
261 { |
252 { |
262 CMdEProperty* prop = NULL; |
|
263 CMdEPropertyDef& originPropDef = iMdeObject->Def().GetPropertyDefL( Object::KOriginProperty ); |
|
264 iMdeObject->Property( originPropDef, prop ); |
|
265 if( prop && prop->Uint8ValueL() == MdeConstants::Object::ECamera && !iFastModeEnabled ) |
|
266 { |
|
267 iFastModeEnabled = ETrue; |
|
268 SetPriority( KHarvesterPriorityMonitorPlugin ); |
|
269 } |
|
270 else if( iFastModeEnabled ) |
|
271 { |
|
272 iFastModeEnabled = EFalse; |
|
273 SetPriority( KHarvesterPriorityComposerPlugin ); |
|
274 } |
|
275 |
|
276 SetNextRequest( ERequestCompose ); |
253 SetNextRequest( ERequestCompose ); |
277 } |
254 } |
278 // if object does not exists, or data is not modified, find next |
255 // if object does not exists, find next |
279 else if ( err == KErrNotFound || err == KErrAbort ) |
256 else if ( err == KErrNotFound || err == KErrAbort ) |
280 { |
257 { |
281 if ( err == KErrAbort && mdeObjectId != KNoId ) |
258 if ( err == KErrAbort && mdeObjectId != KNoId ) |
282 { |
259 { |
283 RArray<TItemId> objectId; |
260 RArray<TItemId> objectId; |
768 User::Leave( KErrNotSupported ); |
744 User::Leave( KErrNotSupported ); |
769 } |
745 } |
770 |
746 |
771 // Check whether the file is open |
747 // Check whether the file is open |
772 TBool isOpen( EFalse ); |
748 TBool isOpen( EFalse ); |
773 const TInt openError = iFs.IsFileOpen( uri, isOpen ); |
749 iFs.IsFileOpen( uri, isOpen ); |
774 if( openError != KErrNone ) |
750 if ( isOpen ) |
775 { |
|
776 WRITELOG( "CImageComposerAO::DoWriteExifL() - check for open file failed!" ); |
|
777 User::Leave( openError ); |
|
778 } |
|
779 else if ( isOpen ) |
|
780 { |
751 { |
781 WRITELOG( "CImageComposerAO::DoWriteExifL() - file handle is open!" ); |
752 WRITELOG( "CImageComposerAO::DoWriteExifL() - file handle is open!" ); |
782 User::Leave( KErrInUse ); |
753 User::Leave( KErrInUse ); |
783 } |
754 } |
784 |
755 |