harvester/client/src/harvestereventobserverao.cpp
branchRCL_3
changeset 3 6752808b2036
parent 0 c53acadfccc6
child 7 3cebc1a84278
equal deleted inserted replaced
2:b73a2e62868f 3:6752808b2036
   133 	if( iObservers.Count() == 0 )
   133 	if( iObservers.Count() == 0 )
   134 		{
   134 		{
   135 		Cancel();
   135 		Cancel();
   136 		iHarvesterEventQueue.Close();
   136 		iHarvesterEventQueue.Close();
   137 		}
   137 		}
       
   138 	
       
   139 	iObservers.Compress();
   138 	}
   140 	}
   139 
   141 
   140 void CHarvesterEventObserverAO::RunL()
   142 void CHarvesterEventObserverAO::RunL()
   141 	{
   143 	{
   142 	User::LeaveIfError( iStatus.Int() );
   144 	User::LeaveIfError( iStatus.Int() );
   143 
   145 
   144 	THarvesterEventNotification received;
   146 	THarvesterEventNotification received;
   145 	while( iHarvesterEventQueue.Receive( received ) != KErrUnderflow )
   147 	while( iHarvesterEventQueue.Receive( received ) != KErrUnderflow )
   146 		{
   148 		{
   147 		for(TInt i = iObservers.Count(); --i >= 0;)
   149 	    const TInt count( iObservers.Count() );
       
   150 		for(TInt i = count; --i >= 0;)
   148 			{
   151 			{
   149 			THarvesterEventObserver& observer = *(iObservers[i]);
   152 			THarvesterEventObserver& observer = *(iObservers[i]);
   150 			if( observer.iObserverInfo.iObserverId == received.iObserverId )
   153 			if( observer.iObserverInfo.iObserverId == received.iObserverId )
   151 				{
   154 				{
   152 				observer.iObserver.HarvestingUpdated( received.iObserverType,  
   155 				observer.iObserver.HarvestingUpdated( received.iObserverType,