harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp
changeset 1 acef663c1218
parent 0 c53acadfccc6
child 2 b73a2e62868f
--- a/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp	Mon Jan 18 20:34:07 2010 +0200
+++ b/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp	Tue Jan 26 12:13:20 2010 +0200
@@ -32,7 +32,7 @@
 
 CMmcScannerAO::CMmcScannerAO( TUint32 aMediaId, 
 		CMdEHarvesterSession* aMdEClient, MMonitorPluginObserver* aObserver, 
-		CHarvesterPluginFactory* aHarvesterPluginFactory, CActive::TPriority aPriority ) : 
+		CHarvesterPluginFactory* aHarvesterPluginFactory, const TInt aPriority ) : 
 		CTimer( aPriority ), iState( EUninitialized ), iMmcFileList( NULL )   
 	{
 	iMediaId = aMediaId;
@@ -43,7 +43,7 @@
 
 CMmcScannerAO* CMmcScannerAO::NewL( TUint32 aMediaId, CMdEHarvesterSession* aMdEClient,
 		MMonitorPluginObserver* aObserver, CHarvesterPluginFactory* aHarvesterPluginFactory, 
-		CActive::TPriority aPriority, TBool aAlreadyWaited )
+		const TInt aPriority, TBool aAlreadyWaited )
 	{
 	CMmcScannerAO* self = new ( ELeave ) CMmcScannerAO( aMediaId, aMdEClient, aObserver, 
 			aHarvesterPluginFactory, aPriority );
@@ -67,7 +67,7 @@
         TInt tmpDelay( KDefaultDelay );
         TTimeIntervalMicroSeconds32 delay( tmpDelay * KMillion ); 
         CRepository* repo = CRepository::NewLC( KRepositoryUid );
-        TInt err = repo->Get( KScanDelayKey, tmpDelay );
+        const TInt err = repo->Get( KScanDelayKey, tmpDelay );
         if ( err == KErrNone )
             {
             delay = tmpDelay * KMillion;
@@ -146,12 +146,12 @@
 				WRITELOG("CMmcScannerAO::RunL - handling file list");
 				iMmcFileList->HandleFileEntryL( *iMdEClient, iEntryArray, 
 						iHarvestEntryArray, iMediaId, iHarvesterPluginFactory );
-				SetState( EHarvestFiles );
-				}
-			else 
-				{
-				SetState( ERemoveNPFiles );
-				}
+				SetState( EProcessFiles );
+                }
+            else 
+                {
+                SetState( EHarvestFiles );
+                }
 			break;
 			}
 		
@@ -165,7 +165,7 @@
 				}
 			else
 				{
-				SetState( EProcessFiles );
+				SetState( ERemoveNPFiles );
 				}
 			break;
 			}
@@ -181,6 +181,8 @@
 		case( EDone ):
 			{
 			iFs.Close();
+			iEntryArray.Compress();
+			iHarvestEntryArray.Compress();
 			break;
 			}