application/src/PodcastShowsView.cpp
branchsymbian1
changeset 336 3d6c1417e8bd
parent 288 757e84a30b9a
child 347 b8d687bb7ca1
--- a/application/src/PodcastShowsView.cpp	Tue Oct 26 15:58:11 2010 +0100
+++ b/application/src/PodcastShowsView.cpp	Fri Nov 12 20:48:14 2010 +0000
@@ -37,7 +37,8 @@
 _LIT(KSizeDownloadingOf, "%.1f/%.1f MB");
 _LIT(KShowsSizeFormatS60, "%.1f MB");
 
-_LIT(KShowFormat, "%d\t%S\t%S%S\t");
+_LIT(KShowFormat, "%d\t%S\t%S%S");
+_LIT(KShowFormatLandscape, "%d\t%S");
 
 // these must correspond with TShowsIconIndex
 
@@ -109,9 +110,7 @@
 	CPodcastListView::ConstructL();
 	
 	CreateIconsL();
-	
-	iListContainer->Listbox()->SetListBoxObserver(this);
-	
+		
 	iPodcastModel.FeedEngine().AddObserver(this);
 	iPodcastModel.ShowEngine().AddObserver(this);
 	
@@ -147,7 +146,8 @@
 		pos+=2;
 		}
 		
-	iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	//iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	iListContainer->SetListboxIcons(icons);
 	CleanupStack::Pop(icons); // icons
 	}
 
@@ -219,7 +219,6 @@
 	
 	UpdateViewTitleL();
 	UpdateFeedUpdateStateL();
-	UpdateToolbar();
 	DP("CPodcastShowsView::DoActivateL END");
 	}
 
@@ -461,6 +460,7 @@
 		}
 		
 	iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize);
+	iListboxFormatbufferShort.Format(KShowFormatLandscape(), iconIndex, &aShowInfo.Title());
 	}
 
 void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode)
@@ -472,13 +472,17 @@
 {
 	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);
 		}
 }
 
@@ -499,6 +503,7 @@
 
 void CPodcastShowsView::UpdateListboxItemsL()
 	{
+	DP("CPodcastShowsView::UpdateListboxItemsL BEGIN");
 	if (iListContainer->IsVisible())
 		{
 		TListItemProperties itemProps;
@@ -538,11 +543,12 @@
 				}
 			else
 				{
-				iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
+				//iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
 				iListContainer->Listbox()->Reset();
 				iItemIdArray.Reset();
 				iItemArray->Reset();
-
+				iItemArrayShort->Reset();
+				
 				if (len > 0)
 					{
 					for (TInt i=0; i<len; i++)
@@ -551,11 +557,14 @@
 						FormatShowInfoListBoxItemL(*si);
 						iItemIdArray.Append(si->Uid());						
 						iItemArray->AppendL(iListboxFormatbuffer);
+						iItemArrayShort->AppendL(iListboxFormatbufferShort);
+												
 						}
 					}
 				else
 					{
 					iItemArray->Reset();
+					iItemArrayShort->Reset();
 					iItemIdArray.Reset();
 					
 					itemProps.SetDimmed(ETrue);
@@ -565,6 +574,7 @@
 				}				
 			}
 		}
+	DP("CPodcastShowsView::UpdateListboxItemsL END");
 	}
 
 /**