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