30 const TUid KRepositoryUid = { 0x20007183 }; |
30 const TUid KRepositoryUid = { 0x20007183 }; |
31 const TUint32 KScanDelayKey = 0x00000001; |
31 const TUint32 KScanDelayKey = 0x00000001; |
32 |
32 |
33 CMmcScannerAO::CMmcScannerAO( TUint32 aMediaId, |
33 CMmcScannerAO::CMmcScannerAO( TUint32 aMediaId, |
34 CMdEHarvesterSession* aMdEClient, MMonitorPluginObserver* aObserver, |
34 CMdEHarvesterSession* aMdEClient, MMonitorPluginObserver* aObserver, |
35 CHarvesterPluginFactory* aHarvesterPluginFactory, CActive::TPriority aPriority ) : |
35 CHarvesterPluginFactory* aHarvesterPluginFactory, const TInt aPriority ) : |
36 CTimer( aPriority ), iState( EUninitialized ), iMmcFileList( NULL ) |
36 CTimer( aPriority ), iState( EUninitialized ), iMmcFileList( NULL ) |
37 { |
37 { |
38 iMediaId = aMediaId; |
38 iMediaId = aMediaId; |
39 iMdEClient = aMdEClient; |
39 iMdEClient = aMdEClient; |
40 iObserver = aObserver; |
40 iObserver = aObserver; |
41 iHarvesterPluginFactory = aHarvesterPluginFactory; |
41 iHarvesterPluginFactory = aHarvesterPluginFactory; |
42 } |
42 } |
43 |
43 |
44 CMmcScannerAO* CMmcScannerAO::NewL( TUint32 aMediaId, CMdEHarvesterSession* aMdEClient, |
44 CMmcScannerAO* CMmcScannerAO::NewL( TUint32 aMediaId, CMdEHarvesterSession* aMdEClient, |
45 MMonitorPluginObserver* aObserver, CHarvesterPluginFactory* aHarvesterPluginFactory, |
45 MMonitorPluginObserver* aObserver, CHarvesterPluginFactory* aHarvesterPluginFactory, |
46 CActive::TPriority aPriority, TBool aAlreadyWaited ) |
46 const TInt aPriority, TBool aAlreadyWaited ) |
47 { |
47 { |
48 CMmcScannerAO* self = new ( ELeave ) CMmcScannerAO( aMediaId, aMdEClient, aObserver, |
48 CMmcScannerAO* self = new ( ELeave ) CMmcScannerAO( aMediaId, aMdEClient, aObserver, |
49 aHarvesterPluginFactory, aPriority ); |
49 aHarvesterPluginFactory, aPriority ); |
50 |
50 |
51 CleanupStack::PushL( self ); |
51 CleanupStack::PushL( self ); |
65 if( !aAlreadyWaited ) |
65 if( !aAlreadyWaited ) |
66 { |
66 { |
67 TInt tmpDelay( KDefaultDelay ); |
67 TInt tmpDelay( KDefaultDelay ); |
68 TTimeIntervalMicroSeconds32 delay( tmpDelay * KMillion ); |
68 TTimeIntervalMicroSeconds32 delay( tmpDelay * KMillion ); |
69 CRepository* repo = CRepository::NewLC( KRepositoryUid ); |
69 CRepository* repo = CRepository::NewLC( KRepositoryUid ); |
70 TInt err = repo->Get( KScanDelayKey, tmpDelay ); |
70 const TInt err = repo->Get( KScanDelayKey, tmpDelay ); |
71 if ( err == KErrNone ) |
71 if ( err == KErrNone ) |
72 { |
72 { |
73 delay = tmpDelay * KMillion; |
73 delay = tmpDelay * KMillion; |
74 } |
74 } |
75 CleanupStack::PopAndDestroy( repo ); |
75 CleanupStack::PopAndDestroy( repo ); |
144 if( iEntryArray.Count() > 0 ) |
144 if( iEntryArray.Count() > 0 ) |
145 { |
145 { |
146 WRITELOG("CMmcScannerAO::RunL - handling file list"); |
146 WRITELOG("CMmcScannerAO::RunL - handling file list"); |
147 iMmcFileList->HandleFileEntryL( *iMdEClient, iEntryArray, |
147 iMmcFileList->HandleFileEntryL( *iMdEClient, iEntryArray, |
148 iHarvestEntryArray, iMediaId, iHarvesterPluginFactory ); |
148 iHarvestEntryArray, iMediaId, iHarvesterPluginFactory ); |
149 SetState( EHarvestFiles ); |
149 SetState( EProcessFiles ); |
150 } |
150 } |
151 else |
151 else |
152 { |
152 { |
153 SetState( ERemoveNPFiles ); |
153 SetState( EHarvestFiles ); |
154 } |
154 } |
155 break; |
155 break; |
156 } |
156 } |
157 |
157 |
158 case( EHarvestFiles ): |
158 case( EHarvestFiles ): |
159 { |
159 { |