application/src/PodcastShowsView.cpp
changeset 6 e211a78d3037
parent 5 ba42cd6670b8
child 8 aab3aa4acdd6
equal deleted inserted replaced
5:ba42cd6670b8 6:e211a78d3037
   295 			TBuf<KMaxMessageLength> message;
   295 			TBuf<KMaxMessageLength> message;
   296 			iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR);
   296 			iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR);
   297 			ShowErrorMessage(message);
   297 			ShowErrorMessage(message);
   298 			}
   298 			}
   299 			break;
   299 			break;
   300 		default: // Do nothing
   300 		default:
   301 			break;
   301 			break;
   302 		}
   302 		}
       
   303 	UpdateListboxItemsL();
   303 	}
   304 	}
   304 
   305 
   305 
   306 
   306 void CPodcastShowsView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid)
   307 void CPodcastShowsView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid)
   307 	{
   308 	{
   463 		aShowInfo.PubDate().FormatL(showDate, KDateFormatShort());
   464 		aShowInfo.PubDate().FormatL(showDate, KDateFormatShort());
   464 		}
   465 		}
   465 
   466 
   466 	if(aShowInfo.LastError() != KErrNone)
   467 	if(aShowInfo.LastError() != KErrNone)
   467 		{
   468 		{
   468 		TBuf<KSizeBufLen> errorBuffer;
   469 		GetShowErrorText(infoSize, aShowInfo.LastError());
   469 		GetShowErrorText(errorBuffer, aShowInfo.LastError());
   470 		}
   470 		iListboxFormatbuffer.Format(KShowErrorFormat(), iconIndex, &aShowInfo.Title(), &errorBuffer);
   471 	
   471 		}
   472 	if (infoSize.Length() > 0)
   472 	else	
   473 		{
   473 		{
   474 		infoSize.Insert(0,_L(", "));
   474 		if (infoSize.Length() > 0) {
       
   475 			infoSize.Insert(0,_L(", "));
       
   476 		}
   475 		}
   477 		
   476 		
   478 		iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize);
   477 	iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize);
   479 		}
       
   480 	}
   478 	}
   481 
   479 
   482 void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode)
   480 void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode)
   483 	{
   481 	{
   484 	iEikonEnv->GetErrorText(aErrorMessage, aErrorCode);
   482 	iEikonEnv->GetErrorText(aErrorMessage, aErrorCode);
   546 
   544 
   547 			if (allUidsMatch && len > 0)
   545 			if (allUidsMatch && len > 0)
   548 				{
   546 				{
   549 				for (TInt loop = 0; loop< len; loop++)
   547 				for (TInt loop = 0; loop< len; loop++)
   550 					{					
   548 					{					
   551 					UpdateShowItemDataL(fItems[loop], loop);	
   549 					UpdateShowItemDataL(fItems[loop], loop);
       
   550 					iListContainer->Listbox()->DrawItem(loop);
   552 					}
   551 					}
   553 				}
   552 				}
   554 			else
   553 			else
   555 				{
   554 				{
   556 				iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
   555 				iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();