application/src/PodcastShowsView.cpp
branchtwolistboxes
changeset 316 841ccfa933ac
parent 314 e7776f6a2198
child 317 5afc95a6ad83
--- a/application/src/PodcastShowsView.cpp	Sun Oct 31 12:32:39 2010 +0000
+++ b/application/src/PodcastShowsView.cpp	Sun Oct 31 13:17:32 2010 +0000
@@ -38,6 +38,7 @@
 _LIT(KShowsSizeFormatS60, "%.1f MB");
 
 _LIT(KShowFormat, "%d\t%S\t%S%S");
+_LIT(KShowFormatLandscape, "%d\t%S");
 
 // these must correspond with TShowsIconIndex
 
@@ -459,6 +460,7 @@
 		}
 		
 	iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize);
+	iListboxFormatbufferShort.Format(KShowFormatLandscape(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize);
 	}
 
 void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode)
@@ -470,16 +472,18 @@
 {
 	FormatShowInfoListBoxItemL(*aShowInfo, aSizeDownloaded);
 	iItemArray->Delete(aIndex);
+	iItemArrayShort->Delete(aIndex);
+	
 	if(aIndex>= iItemArray->MdcaCount())
 		{
 		iItemArray->AppendL(iListboxFormatbuffer);
+		iItemArrayShort->AppendL(iListboxFormatbufferShort);
 		}
 	else
 		{
 		iItemArray->InsertL(aIndex, iListboxFormatbuffer);
+		iItemArrayShort->InsertL(aIndex, iListboxFormatbufferShort);
 		}
-	
-	iListContainer->SetTextArray(iItemArray);
 }
 
 void CPodcastShowsView::UpdateShowItemL(TUint aUid, TInt aSizeDownloaded)
@@ -542,7 +546,8 @@
 				iListContainer->Listbox()->Reset();
 				iItemIdArray.Reset();
 				iItemArray->Reset();
-
+				iItemArrayShort->Reset();
+				
 				if (len > 0)
 					{
 					for (TInt i=0; i<len; i++)
@@ -551,17 +556,19 @@
 						FormatShowInfoListBoxItemL(*si);
 						iItemIdArray.Append(si->Uid());						
 						iItemArray->AppendL(iListboxFormatbuffer);
+						iItemArrayShort->AppendL(iListboxFormatbufferShort);
+												
 						}
 					}
 				else
 					{
 					iItemArray->Reset();
+					iItemArrayShort->Reset();
 					iItemIdArray.Reset();
 					
 					itemProps.SetDimmed(ETrue);
 					itemProps.SetHiddenSelection(ETrue);
 					}
-				iListContainer->SetTextArray(iItemArray);
 				iListContainer->Listbox()->HandleItemAdditionL();
 				}				
 			}