harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp
branchCompilerCompatibility
changeset 13 16369ba02293
parent 8 6752808b2036
child 15 3cebc1a84278
equal deleted inserted replaced
10:67b0a665852a 13:16369ba02293
    20 #include <placeholderdata.h>
    20 #include <placeholderdata.h>
    21 #include <centralrepository.h>
    21 #include <centralrepository.h>
    22 
    22 
    23 _LIT( KColon, ":" );
    23 _LIT( KColon, ":" );
    24 
    24 
    25 const TInt KDefaultDelay = 4;
    25 const TInt KDefaultDelay = 3;
    26 const TInt KMillion = 1000000;
    26 const TInt KMillion = 1000000;
    27 
    27 
    28 const TUid KRepositoryUid = { 0x20007183 };
    28 const TUid KRepositoryUid = { 0x20007183 };
    29 const TUint32 KScanDelayKey = 0x00000001;
    29 const TUint32 KScanDelayKey = 0x00000001;
    30 
    30 
    76 	else
    76 	else
    77 	    {
    77 	    {
    78 	    TTimeIntervalMicroSeconds32 delay( 5 ); 
    78 	    TTimeIntervalMicroSeconds32 delay( 5 ); 
    79 	    After( delay );
    79 	    After( delay );
    80 	    }
    80 	    }
       
    81 	
       
    82     iHEM = CHarvesterEventManager::GetInstanceL();
    81 	}
    83 	}
    82 
    84 
    83 CMmcScannerAO::~CMmcScannerAO()
    85 CMmcScannerAO::~CMmcScannerAO()
    84 	{
    86 	{
    85 	Cancel(); // Cancel any request, if outstanding
    87 	Cancel(); // Cancel any request, if outstanding
    93 	iHarvestEntryArray.ResetAndDestroy();
    95 	iHarvestEntryArray.ResetAndDestroy();
    94 	iHarvestEntryArray.Close();
    96 	iHarvestEntryArray.Close();
    95 	
    97 	
    96     iHdArray.ResetAndDestroy();
    98     iHdArray.ResetAndDestroy();
    97 	iHdArray.Close();
    99 	iHdArray.Close();
       
   100 
       
   101     if (iHEM)
       
   102         {
       
   103         iHEM->ReleaseInstance();
       
   104         }
    98 	
   105 	
    99 	iFs.Close();
   106 	iFs.Close();
   100 	}
   107 	}
   101 
   108 
   102 
   109 
   134 				break;
   141 				break;
   135 				}
   142 				}
   136 			
   143 			
   137 			WRITELOG("CMmcScannerAO::RunL - build file list");
   144 			WRITELOG("CMmcScannerAO::RunL - build file list");
   138 			iMmcFileList->BuildFileListL( iFs, iDrive, iEntryArray );
   145 			iMmcFileList->BuildFileListL( iFs, iDrive, iEntryArray );
       
   146 			
       
   147             // send start event
       
   148             const TInt entryCount = iEntryArray.Count();
       
   149             if( entryCount > 0 )
       
   150                 {
       
   151                 iHEM->IncreaseItemCount( EHEObserverTypeMMC, entryCount );
       
   152                 iHEM->SendEventL( EHEObserverTypeMMC, EHEStateStarted, iHEM->ItemCount( EHEObserverTypeMMC ) );
       
   153                 }
       
   154 			
   139 			SetState( EProcessFiles );
   155 			SetState( EProcessFiles );
   140 			break;
   156 			break;
   141 			}
   157 			}
   142 		
   158 		
   143 		case( EProcessFiles ):
   159 		case( EProcessFiles ):