application/src/PodcastShowsView.cpp
changeset 107 af6475fdf8d6
parent 96 a8538f50e2ba
child 112 0bd6b9a3f027
equal deleted inserted replaced
106:83752b9e3cb6 107:af6475fdf8d6
   442 	iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize);
   442 	iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize);
   443 	}
   443 	}
   444 
   444 
   445 void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode)
   445 void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode)
   446 	{
   446 	{
   447 	iEikonEnv->GetErrorText(aErrorMessage, aErrorCode);
   447 	switch (aErrorCode)
       
   448 		{
       
   449 		case -1:
       
   450 			{
       
   451 			HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_INVALID_ADDRESS);
       
   452 			aErrorMessage.Copy(*error);
       
   453 			CleanupStack::PopAndDestroy(error);
       
   454 			}
       
   455 			break;
       
   456 		case 404:
       
   457 			{
       
   458 			HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_NOTFOUND);
       
   459 			aErrorMessage.Copy(*error);
       
   460 			CleanupStack::PopAndDestroy(error);
       
   461 			}
       
   462 			break;
       
   463 		default:
       
   464 			{
       
   465 			if (aErrorCode > 200)
       
   466 				{
       
   467 				HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_HTTP);
       
   468 				aErrorMessage.Format(*error, aErrorCode);
       
   469 				CleanupStack::PopAndDestroy(error);
       
   470 				}
       
   471 			else
       
   472 				{
       
   473 				HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_GENERAL);
       
   474 				aErrorMessage.Format(*error, aErrorCode);
       
   475 				CleanupStack::PopAndDestroy(error);
       
   476 				}
       
   477 			}
       
   478 			break;
       
   479 		}
   448 	}
   480 	}
   449 
   481 
   450 void CPodcastShowsView::UpdateShowItemDataL(CShowInfo* aShowInfo,TInt aIndex, TInt aSizeDownloaded)
   482 void CPodcastShowsView::UpdateShowItemDataL(CShowInfo* aShowInfo,TInt aIndex, TInt aSizeDownloaded)
   451 {
   483 {
   452 	FormatShowInfoListBoxItemL(*aShowInfo, aSizeDownloaded);
   484 	FormatShowInfoListBoxItemL(*aShowInfo, aSizeDownloaded);