35 using namespace MdeConstants; |
35 using namespace MdeConstants; |
36 |
36 |
37 const TUid KRepositoryUid = { 0x20007182 }; |
37 const TUid KRepositoryUid = { 0x20007182 }; |
38 const TUint32 KCacheSizeKey = 0x00000001; |
38 const TUint32 KCacheSizeKey = 0x00000001; |
39 |
39 |
40 const TInt KMaxEventsAtTime = 20; |
40 const TInt KMaxEventsAtTime = 25; |
41 const TInt KMaxEventsGranularity = 20; |
41 const TInt KMaxEventsGranularity = 20; |
42 |
42 |
43 // --------------------------------------------------------------------------- |
43 // --------------------------------------------------------------------------- |
44 // CFileEventHandlerAO::NewL() |
44 // CFileEventHandlerAO::NewL() |
45 // --------------------------------------------------------------------------- |
45 // --------------------------------------------------------------------------- |
216 TBool fastHarvest( EFalse ); |
216 TBool fastHarvest( EFalse ); |
217 |
217 |
218 TOrigin origin = MdeConstants::Object::EOther; |
218 TOrigin origin = MdeConstants::Object::EOther; |
219 if ( iMapper ) |
219 if ( iMapper ) |
220 { |
220 { |
221 TRAPD( originErr, origin = iMapper->OriginL( status.iProcessId ) ); |
221 origin = iMapper->OriginL( status.iProcessId ); |
222 if( originErr == KErrNone ) |
222 if ( origin == KOriginIgnored ) |
223 { |
223 { |
224 if ( origin == KOriginIgnored ) |
224 WRITELOG1( "CFileEventHandlerAO::HandleNotificationL - ignored origin for %S", &status.iFileName ); |
225 { |
225 return; |
226 WRITELOG1( "CFileEventHandlerAO::HandleNotificationL - ignored origin for %S", &status.iFileName ); |
226 } |
227 return; |
227 else if( origin == KOriginFastHarvest ) |
228 } |
228 { |
229 else if( origin == KOriginFastHarvest ) |
229 WRITELOG( "CFileEventHandlerAO::HandleNotificationL - potential fast harvest file detected" ); |
230 { |
230 fastHarvest = ETrue; |
231 WRITELOG( "CFileEventHandlerAO::HandleNotificationL - potential fast harvest file detected" ); |
231 } |
232 fastHarvest = ETrue; |
232 |
233 } |
233 _LIT(KCameraTemp,"camcordertmp"); |
234 |
234 if ( origin == MdeConstants::Object::ECamera && |
235 _LIT(KCameraTemp,"camcordertmp"); |
235 (aEvent.iFileEventType == EMdsFileCreated || |
236 if ( origin == MdeConstants::Object::ECamera && |
236 aEvent.iFileName.FindF(KCameraTemp) != KErrNotFound) ) |
237 (aEvent.iFileEventType == EMdsFileCreated || |
237 { |
238 aEvent.iFileName.FindF(KCameraTemp) != KErrNotFound) ) |
238 WRITELOG1( "CFileEventHandlerAO::HandleNotificationL - ignored camera origin for %S", &status.iFileName ); |
239 { |
239 return; |
240 WRITELOG1( "CFileEventHandlerAO::HandleNotificationL - ignored camera origin for %S", &status.iFileName ); |
240 } |
241 return; |
|
242 } |
|
243 } |
|
244 else |
|
245 { |
|
246 origin = MdeConstants::Object::EOther; |
|
247 } |
|
248 } |
241 } |
249 |
242 |
250 // ignore created file event if extension is not supported by any harverter plugin |
243 // ignore created file event if extension is not supported by any harverter plugin |
251 if( EMdsFileCreated == status.iFileEventType && |
244 if( EMdsFileCreated == status.iFileEventType && |
252 status.iFileName.Length() > 0 ) |
245 status.iFileName.Length() > 0 ) |
305 // move event |
298 // move event |
306 CleanupStack::PushL( hd ); |
299 CleanupStack::PushL( hd ); |
307 RenameToMDEL( status.iFileName, hd->Uri(), hd->Origin() ); |
300 RenameToMDEL( status.iFileName, hd->Uri(), hd->Origin() ); |
308 CleanupStack::PopAndDestroy( hd ); |
301 CleanupStack::PopAndDestroy( hd ); |
309 } |
302 } |
310 |
303 else |
311 DeleteFromMDEL( status.iFileName ); |
304 { |
|
305 DeleteFromMDEL( status.iFileName ); |
|
306 } |
312 } |
307 } |
313 break; |
308 break; |
314 |
309 |
315 case EMdsDriveFormatted: |
310 case EMdsDriveFormatted: |
316 { |
311 { |
347 TMdsFSPStatus& status = (*aEvents)[i]; |
342 TMdsFSPStatus& status = (*aEvents)[i]; |
348 |
343 |
349 TOrigin origin = MdeConstants::Object::EOther; |
344 TOrigin origin = MdeConstants::Object::EOther; |
350 if ( iMapper ) |
345 if ( iMapper ) |
351 { |
346 { |
352 TRAPD( originErr, origin = iMapper->OriginL( status.iProcessId ) ); |
347 origin = iMapper->OriginL( status.iProcessId ); |
353 if( originErr == KErrNone ) |
348 // Used only for delete events so fast harvest origin is not used |
|
349 if ( origin == KOriginIgnored ) |
354 { |
350 { |
355 if ( origin == KOriginIgnored ) |
351 WRITELOG1( "CFileEventHandlerAO::HandleMultideletionL - ignored origin for %S", &status.iFileName ); |
356 { |
352 continue; |
357 WRITELOG1( "CFileEventHandlerAO::HandleMultideletionL - ignored origin for %S", &status.iFileName ); |
|
358 continue; |
|
359 } |
|
360 } |
353 } |
361 } |
354 } |
362 |
355 |
363 WRITELOG1( "CFileEventHandlerAO::HandleMultideletionL - EmdsFileDeleted: %S", &status.iFileName ); |
356 WRITELOG1( "CFileEventHandlerAO::HandleMultideletionL - EmdsFileDeleted: %S", &status.iFileName ); |
364 CHarvesterData* hd = iMoveTimer->CheckUriL( status.iFileName ); |
357 CHarvesterData* hd = iMoveTimer->CheckUriL( status.iFileName ); |
367 // move event |
360 // move event |
368 CleanupStack::PushL( hd ); |
361 CleanupStack::PushL( hd ); |
369 RenameToMDEL( status.iFileName, hd->Uri(), hd->Origin() ); |
362 RenameToMDEL( status.iFileName, hd->Uri(), hd->Origin() ); |
370 CleanupStack::PopAndDestroy( hd ); |
363 CleanupStack::PopAndDestroy( hd ); |
371 } |
364 } |
372 iUriArray.Append( &(status.iFileName) ); |
365 else |
|
366 { |
|
367 iUriArray.Append( &(status.iFileName) ); |
|
368 } |
373 } |
369 } |
374 MultiDeleteFromMDEL( iUriArray ); |
370 MultiDeleteFromMDEL( iUriArray ); |
375 } |
371 } |
376 |
372 |
377 // --------------------------------------------------------------------------- |
373 // --------------------------------------------------------------------------- |
801 CActive( KHarvesterPriorityMonitorPlugin ) |
797 CActive( KHarvesterPriorityMonitorPlugin ) |
802 { |
798 { |
803 } |
799 } |
804 |
800 |
805 // --------------------------------------------------------------------------- |
801 // --------------------------------------------------------------------------- |
806 // CFileEventHandlerAO::SetIgnoreListL() |
|
807 // --------------------------------------------------------------------------- |
|
808 // |
|
809 void CFileEventHandlerAO::SetIgnoreListL( RPointerArray<TDesC>& aList ) |
|
810 { |
|
811 WRITELOG( "CFileEventHandlerAO::SetIgnoreListL" ); |
|
812 |
|
813 iIgnoreList.ResetAndDestroy(); |
|
814 |
|
815 const TInt count( aList.Count() ); |
|
816 for ( TInt i = count; --i >= 0; ) |
|
817 { |
|
818 TDesC* listPath = aList[i]; |
|
819 |
|
820 HBufC* name = listPath->AllocLC(); |
|
821 |
|
822 iIgnoreList.AppendL( name ); |
|
823 |
|
824 CleanupStack::Pop( name ); |
|
825 } |
|
826 } |
|
827 |
|
828 // --------------------------------------------------------------------------- |
|
829 // CFileEventHandlerAO::Mapper() |
802 // CFileEventHandlerAO::Mapper() |
830 // Returns a handle to CProcessOriginMapper. |
803 // Returns a handle to CProcessOriginMapper. |
831 // --------------------------------------------------------------------------- |
804 // --------------------------------------------------------------------------- |
832 // |
805 // |
833 CProcessOriginMapper& CFileEventHandlerAO::Mapper() |
806 CProcessOriginMapper& CFileEventHandlerAO::Mapper() |