application/src/PodcastFeedView.cpp
branchRCL_3
changeset 311 606f4f6babf6
parent 306 a36dc474cae2
child 312 2faae209e72b
--- a/application/src/PodcastFeedView.cpp	Sat Oct 30 13:52:07 2010 +0100
+++ b/application/src/PodcastFeedView.cpp	Sat Oct 30 14:06:37 2010 +0100
@@ -163,6 +163,7 @@
 	                                  TUid aCustomMessageId,
 	                                  const TDesC8& aCustomMessage)
 	{
+	DP("CPodcastFeedView::DoActivateL BEGIN");
 	CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
 	
 	if (aPrevViewId.iViewUid == KUidPodcastShowsViewID)
@@ -177,8 +178,9 @@
 	if (iFirstActivateAfterLaunch)
 		{
 		iFirstActivateAfterLaunch = EFalse;
-		iListContainer->Listbox()->ScrollToMakeItemVisible(0);
 		}
+
+	DP("CPodcastFeedView::DoActivateL END");
 	}
 
 void CPodcastFeedView::DoDeactivate()
@@ -365,7 +367,8 @@
 		CFbsBitmap* bmpCopy = new (ELeave) CFbsBitmap;
 		CleanupStack::PushL(bmpCopy);
 		bmpCopy->Duplicate(aFeedInfo.FeedIcon()->Handle());
-		icons->AppendL( CGulIcon::NewL(bmpCopy, NULL));
+		icons->AppendL( CGulIcon::NewL(AknIconUtils::CreateIconL(bmpCopy), NULL));
+		
 		iFeedIdForIconArray.Append(aFeedInfo.Uid());
 		CleanupStack::Pop(bmpCopy);			
 		iconIndex = icons->Count()-1;
@@ -567,6 +570,22 @@
 	CleanupStack::PopAndDestroy( array );		
 	}
 
+void CPodcastFeedView::ShowItem(TUint aUid)
+	{
+	TInt listIndex = -1;
+	for (TUint i=0;i<iItemIdArray.Count();i++)
+		{
+		if (iItemIdArray[i] == aUid)
+			{
+			listIndex = i;
+			}
+		}
+		
+	if (listIndex != -1)
+		iListContainer->Listbox()->ScrollToMakeItemVisible(listIndex);
+
+	}
+
 void CPodcastFeedView::HandleAddFeedUrlL()
 	{
 	TBuf<KFeedUrlLength> url;
@@ -599,10 +618,7 @@
 			iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS);
 			if(ShowQueryMessageL(message))
 				{
-				CFeedInfo *info = iPodcastModel.FeedEngine().GetFeedInfoByUid(newFeedInfo->Uid());
-				
-				iPodcastModel.SetActiveFeedInfo(info);			
-				AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID,  TUid::Uid(0), KNullDesC8());
+				ShowItem(newFeedInfo->Uid());
 				iPodcastModel.FeedEngine().UpdateFeedL(newFeedInfo->Uid());
 				}
 			}