harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp
changeset 20 6dfc5f825351
parent 3 b73a2e62868f
child 15 3cebc1a84278
--- a/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp	Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp	Fri Mar 19 09:38:01 2010 +0200
@@ -22,7 +22,7 @@
 
 _LIT( KColon, ":" );
 
-const TInt KDefaultDelay = 4;
+const TInt KDefaultDelay = 3;
 const TInt KMillion = 1000000;
 
 const TUid KRepositoryUid = { 0x20007183 };
@@ -78,6 +78,8 @@
 	    TTimeIntervalMicroSeconds32 delay( 5 ); 
 	    After( delay );
 	    }
+	
+    iHEM = CHarvesterEventManager::GetInstanceL();
 	}
 
 CMmcScannerAO::~CMmcScannerAO()
@@ -95,6 +97,11 @@
 	
     iHdArray.ResetAndDestroy();
 	iHdArray.Close();
+
+    if (iHEM)
+        {
+        iHEM->ReleaseInstance();
+        }
 	
 	iFs.Close();
 	}
@@ -136,6 +143,15 @@
 			
 			WRITELOG("CMmcScannerAO::RunL - build file list");
 			iMmcFileList->BuildFileListL( iFs, iDrive, iEntryArray );
+			
+            // send start event
+            const TInt entryCount = iEntryArray.Count();
+            if( entryCount > 0 )
+                {
+                iHEM->IncreaseItemCount( EHEObserverTypeMMC, entryCount );
+                iHEM->SendEventL( EHEObserverTypeMMC, EHEStateStarted, iHEM->ItemCount( EHEObserverTypeMMC ) );
+                }
+			
 			SetState( EProcessFiles );
 			break;
 			}