Cleanup twolistboxes
authorSebastian Brannstrom <sebastianb@symbian.org>
Sun, 31 Oct 2010 12:32:39 +0000
branchtwolistboxes
changeset 315 091fa3bf3295
parent 314 e7776f6a2198
child 316 841ccfa933ac
Cleanup
application/inc/PodcastListView.h
application/src/PodcastFeedView.cpp
application/src/PodcastListView.cpp
--- a/application/inc/PodcastListView.h	Sun Oct 31 12:16:04 2010 +0000
+++ b/application/inc/PodcastListView.h	Sun Oct 31 12:32:39 2010 +0000
@@ -66,15 +66,18 @@
 		void ScrollToVisible();
     	void Draw(const TRect& aRect) const;   	
     	TBool IsLandscape();
-	protected:
+
+    public:
+       	CAknSingleLargeStyleListBox * iListboxLandscape;
+        CAknDoubleLargeStyleListBox * iListboxPortrait;
+
+    protected:
 		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
 
 	private:
 		MContainerListener* iContainerListener;
         CAknsBasicBackgroundControlContext* iBgContext;
         
-       	CAknSingleLargeStyleListBox * iListboxLandscape;
-        CAknDoubleLargeStyleListBox * iListboxPortrait;
         CEikColumnListBox * iListbox;
         TBool iLandscape;
 		CDesCArray* iItemArrayShort;
--- a/application/src/PodcastFeedView.cpp	Sun Oct 31 12:16:04 2010 +0000
+++ b/application/src/PodcastFeedView.cpp	Sun Oct 31 12:32:39 2010 +0000
@@ -226,7 +226,7 @@
 
 void CPodcastFeedView::HandleListBoxEventL(CEikListBox* /* aListBox */, TListBoxEvent aEventType)
 	{
-	DP("CPodcastFeedView::HandleListBoxEventL BEGIN");
+//	DP("CPodcastFeedView::HandleListBoxEventL BEGIN");
 
 	switch(aEventType)
 		{
@@ -250,7 +250,7 @@
 	default:
 		break;
 		}
-	DP("CPodcastFeedView::HandleListBoxEventL END");
+//	DP("CPodcastFeedView::HandleListBoxEventL END");
 	}
 
 void CPodcastFeedView::FeedUpdateAllCompleteL(TFeedState /*aState*/)
@@ -537,9 +537,8 @@
 			break;
 		case EPodcastUpdateAllFeeds:
 			{
-			SwitchListbox();
-			//iPodcastModel.FeedEngine().UpdateAllFeedsL();
-			//UpdateToolbar();
+			iPodcastModel.FeedEngine().UpdateAllFeedsL();
+			UpdateToolbar();
 			}break;
 		case EPodcastUpdateFeed:
 			{
--- a/application/src/PodcastListView.cpp	Sun Oct 31 12:16:04 2010 +0000
+++ b/application/src/PodcastListView.cpp	Sun Oct 31 12:32:39 2010 +0000
@@ -87,14 +87,12 @@
 	
 	if (aRect.Width() > aRect.Height())
 		{
-		DP("Landscape mode");
 		iLandscape = ETrue;
 		iListbox = iListboxLandscape;
 		iListboxLandscape->MakeVisible(ETrue);
 		}
 	else 
 		{
-		DP("Portrait mode");
 		iLandscape = EFalse;
 		iListboxPortrait->MakeVisible(ETrue);
 		iListbox = (CEikColumnListBox*) iListboxPortrait;
@@ -154,16 +152,12 @@
 {
 	DP2("CPodcastListContainer::SizeChanged() BEGIN, width=%d, height=%d",Size().iWidth, Size().iHeight);
 
-	//TBool nowLandscape = ETrue;//!iLandscape;
-	TBool nowLandscape = Size().iWidth > Size().iHeight;
-	//TBool orientationChanged = nowLandscape && !iLandscape;
-
-	iLandscape = nowLandscape;
+	iLandscape = Size().iWidth > Size().iHeight;
 
 	if (iContainerListener)
 		iContainerListener->SizeChanged();
 	
-	if (nowLandscape)
+	if (iLandscape)
 		{
 		iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff );
 		iListboxPortrait->UpdateScrollBarsL();
@@ -220,7 +214,6 @@
 	{
 	DP1("SetTextArray, aArray.Count=%d", aArray->Count());
 	iItemArrayShort->Reset();
-	DP("after reset");
 	for (int i=0;i<aArray->Count();i++)
 		{
 		TBuf<1024> line;
@@ -448,7 +441,8 @@
 void CPodcastListView::SetEmptyTextL(TInt aResourceId)
 	{
 	HBufC* emptyText =  iEikonEnv->AllocReadResourceLC(aResourceId);
-	iListContainer->Listbox()->View()->SetListEmptyTextL(*emptyText);
+	iListContainer->iListboxPortrait->View()->SetListEmptyTextL(*emptyText);
+	iListContainer->iListboxLandscape->View()->SetListEmptyTextL(*emptyText);
 	CleanupStack::PopAndDestroy(emptyText);	
 	}