harvester/server/src/ondemandao.cpp
branchRCL_3
changeset 63 e538444823de
parent 53 29d87345eaeb
equal deleted inserted replaced
57:2872ae438bf7 63:e538444823de
    62 	WRITELOG("COnDemandAO::~COnDemandAO");
    62 	WRITELOG("COnDemandAO::~COnDemandAO");
    63 	Cancel (); // Cancel any request, if outstanding
    63 	Cancel (); // Cancel any request, if outstanding
    64 	if( iMdEHarvesterSession )
    64 	if( iMdEHarvesterSession )
    65 		{
    65 		{
    66 		delete iMdEHarvesterSession;
    66 		delete iMdEHarvesterSession;
    67 		iMdEHarvesterSession = NULL;
       
    68 		}
    67 		}
    69 	// Delete instance variables if any
    68 	// Delete instance variables if any
    70 	}
    69 	}
    71 
    70 
    72 void COnDemandAO::DoCancel()
    71 void COnDemandAO::DoCancel()
    73 	{
    72 	{
    74 	WRITELOG("COnDemandAO::DoCancel");
    73 	WRITELOG("COnDemandAO::DoCancel");
    75 	iMdEHarvesterSession->CancelHarvestingPrioritizationObserver();
    74 	iMdEHarvesterSession->CancelHarvestingPrioritizationObserver ();
    76 	}
    75 	}
    77 
    76 
    78 void COnDemandAO::StartL()
    77 void COnDemandAO::StartL()
    79 	{
    78 	{
    80 	WRITELOG("COnDemandAO::StartL");
    79 	WRITELOG("COnDemandAO::StartL");
    81 	// Cancel any request, just to be sure
    80 	// Cancel any request, just to be sure
    82 	Cancel ();
    81 	Cancel ();
    83 	iMdEHarvesterSession->SetHarvestingPrioritizationChunkL( 16384 );
    82 	iMdEHarvesterSession->SetHarvestingPrioritizationChunkL ( 16384 );
    84 	WaitHarvestingRequest ();
    83 	WaitHarvestingRequest ();
    85 	}
    84 	}
    86 
    85 
    87 void COnDemandAO::RunL()
    86 void COnDemandAO::RunL()
    88 	{
    87 	{
   114 							WRITELOG2("COnDemandAO::RunL URI %S found in plugin %d queue", uri, j);
   113 							WRITELOG2("COnDemandAO::RunL URI %S found in plugin %d queue", uri, j);
   115 							CHarvesterData* hd = queue[k];
   114 							CHarvesterData* hd = queue[k];
   116 							hd->SetEventType( EHarvesterEdit );
   115 							hd->SetEventType( EHarvesterEdit );
   117 							hd->SetObjectType( EFastHarvest );
   116 							hd->SetObjectType( EFastHarvest );
   118 							queue.Remove( k );
   117 							queue.Remove( k );
   119 
   118 							queue.Insert( hd, 0 );
   120 							if(queue.Insert( hd, 0 ) != KErrNone)
   119 							found = ETrue;
   121 							    {
       
   122                                 delete hd;
       
   123                                 hd = NULL;
       
   124 							    }
       
   125 							
       
   126                             found = ETrue;
       
   127 							}							
   120 							}							
   128 						}
   121 						}
   129 					}
   122 					}
   130 
   123 
   131 				const TInt readyPhArraySize = iReadyPhArray->Count();
   124 				const TInt readyPhArraySize = iReadyPhArray->Count();