engine/src/FeedEngine.cpp
changeset 73 83752b9e3cb6
parent 69 04c6ccce8e7e
child 74 af6475fdf8d6
equal deleted inserted replaced
72:236022094302 73:83752b9e3cb6
   214 		{
   214 		{
   215 		User::Leave(KErrInUse);
   215 		User::Leave(KErrInUse);
   216 		}
   216 		}
   217 	
   217 	
   218 	iActiveFeed = GetFeedInfoByUid(aFeedUid);
   218 	iActiveFeed = GetFeedInfoByUid(aFeedUid);
   219 	iCatchupCounter = 0;
   219 	
   220 	iCancelRequested = EFalse;
   220 	iCancelRequested = EFalse;
   221 
   221 
   222 	if (iActiveFeed->LastUpdated() == 0)
   222 	if (iActiveFeed->LastUpdated() == 0)
   223 		{
   223 		{
   224 		iCatchupMode = ETrue;
   224 		iCatchupMode = ETrue;
       
   225 		iCatchupCounter = 0;
   225 		}
   226 		}
   226 	
   227 	
   227 	iActiveFeed->SetLastError(KErrNone);
   228 	iActiveFeed->SetLastError(KErrNone);
   228 	DBUpdateFeedL(*iActiveFeed);
   229 	DBUpdateFeedL(*iActiveFeed);
   229 	
   230 	
   532 
   533 
   533 	switch(iClientState)
   534 	switch(iClientState)
   534 		{		
   535 		{		
   535 		case EUpdatingFeed: 
   536 		case EUpdatingFeed: 
   536 		{
   537 		{
   537 		// Parse the feed. We need to trap this call since it could leave and then
       
   538 		// the whole update chain will be broken
       
   539 		// change client state
       
   540 		iClientState = EIdle;
   538 		iClientState = EIdle;
   541 		switch (aError)
   539 		switch (aError)
   542 			{
   540 			{
   543 			case KErrCancel:						
   541 			case KErrCancel:						
   544 				{
   542 				{
   555 					TTime time;
   553 					TTime time;
   556 					time.HomeTime();
   554 					time.HomeTime();
   557 					iActiveFeed->SetLastUpdated(time);
   555 					iActiveFeed->SetLastUpdated(time);
   558 	
   556 	
   559 					if( aError == KErrNone)
   557 					if( aError == KErrNone)
   560 						{			
   558 						{
       
   559 						// Parse the feed. We need to trap this call since it could leave and then
       
   560 						// the whole update chain will be broken
       
   561 						// change client state
   561 						TRAPD(parserErr, iParser->ParseFeedL(iUpdatingFeedFileName, iActiveFeed, iPodcastModel.SettingsEngine().MaxListItems()));
   562 						TRAPD(parserErr, iParser->ParseFeedL(iUpdatingFeedFileName, iActiveFeed, iPodcastModel.SettingsEngine().MaxListItems()));
   562 	
   563 	
   563 						if(parserErr)
   564 						if(parserErr)
   564 							{
   565 							{
   565 							// we do not need to any special action on this error.
   566 							// we do not need to any special action on this error.
   617 					{
   618 					{
   618 						// If this fails, no reason to worry
   619 						// If this fails, no reason to worry
   619 					TRAP_IGNORE(iPodcastModel.ImageHandler().LoadFileAndScaleL(iActiveFeed->FeedIcon(), iActiveFeed->ImageFileName(), TSize(64,56), *iActiveFeed, iActiveFeed->Uid()));
   620 					TRAP_IGNORE(iPodcastModel.ImageHandler().LoadFileAndScaleL(iActiveFeed->FeedIcon(), iActiveFeed->ImageFileName(), TSize(64,56), *iActiveFeed, iActiveFeed->Uid()));
   620 					}				
   621 					}				
   621 				}
   622 				}
   622 			
   623 			DBUpdateFeedL(*iActiveFeed);
   623 			NotifyFeedUpdateComplete(iActiveFeed->Uid(), aError);
   624 			NotifyFeedUpdateComplete(iActiveFeed->Uid(), aError);
   624 			UpdateNextFeedL();
   625 			UpdateNextFeedL();
   625 			}break;
   626 			}break;
   626 		case ESearching: 
   627 		case ESearching: 
   627 			{
   628 			{