application/src/PodcastFeedView.cpp
changeset 109 223f270fa7ff
parent 107 af6475fdf8d6
child 112 0bd6b9a3f027
equal deleted inserted replaced
108:554d9980157f 109:223f270fa7ff
   202 	{
   202 	{
   203 	DP("CPodcastFeedView::HandleListBoxEventL BEGIN");
   203 	DP("CPodcastFeedView::HandleListBoxEventL BEGIN");
   204 
   204 
   205 	switch(aEventType)
   205 	switch(aEventType)
   206 		{
   206 		{
   207 		case EEventPenDownOnItem:
       
   208 			DP("PEN DOWN");
       
   209 			break;
       
   210 			
       
   211 #ifndef SYMBIAN1_UI
   207 #ifndef SYMBIAN1_UI
   212 	case EEventItemClicked:
   208 	case EEventItemClicked:
   213 #endif
   209 #endif
   214 	case EEventEnterKeyPressed:
   210 	case EEventEnterKeyPressed:
   215 	case EEventItemDoubleClicked:
   211 	case EEventItemDoubleClicked:
   216 	case EEventItemActioned:
   212 	case EEventItemActioned:
   217 		DP("DOUBLE TAP");
       
   218 			{
   213 			{
   219 			const RFeedInfoArray* sortedItems = NULL;
   214 			const RFeedInfoArray* sortedItems = NULL;
   220 			TInt index = iListContainer->Listbox()->CurrentItemIndex();
   215 			TInt index = iListContainer->Listbox()->CurrentItemIndex();
   221 			sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds();
   216 			sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds();
   222 
   217 
   332 		iEikonEnv->ReadResourceL(updatedDate, R_PODCAST_FEEDS_IS_UPDATING);
   327 		iEikonEnv->ReadResourceL(updatedDate, R_PODCAST_FEEDS_IS_UPDATING);
   333 		unplayedShows = KNullDesC();			
   328 		unplayedShows = KNullDesC();			
   334 		}
   329 		}
   335 	else
   330 	else
   336 		{
   331 		{
   337 		iPodcastModel.FeedEngine().GetStatsByFeed(aFeedInfo.Uid(), showCount, unplayedCount);	
   332 		// we will get a leave if there are no shows for this feed, for instance, which is fine
       
   333 		TRAP_IGNORE(iPodcastModel.FeedEngine().GetStatsByFeedL(aFeedInfo.Uid(), showCount, unplayedCount));	
   338 		
   334 		
   339 		if (unplayedCount) {
   335 		if (unplayedCount) {
   340 			unplayedShows.Format(*iFeedsFormat, unplayedCount);
   336 			unplayedShows.Format(*iFeedsFormat, unplayedCount);
   341 		} else {
   337 		} else {
   342 			unplayedShows.Zero();
   338 			unplayedShows.Zero();
   368 			GetFeedErrorText(unplayedShows, aFeedInfo.LastError());
   364 			GetFeedErrorText(unplayedShows, aFeedInfo.LastError());
   369 			}
   365 			}
   370 		}
   366 		}
   371 	CArrayPtr<CGulIcon>* icons = iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->IconArray();
   367 	CArrayPtr<CGulIcon>* icons = iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->IconArray();
   372 	iconIndex = iFeedIdForIconArray.Find(aFeedInfo.Uid());
   368 	iconIndex = iFeedIdForIconArray.Find(aFeedInfo.Uid());
   373 	if(iconIndex == KErrNotFound && aFeedInfo.FeedIcon() != NULL && 
   369 	if(iconIndex == KErrNotFound && aFeedInfo.FeedIcon() != NULL && aFeedInfo.ImageFileName().Length() > 0 && 
   374 			aFeedInfo.FeedIcon()->SizeInPixels().iHeight > 0 &&
   370 			aFeedInfo.FeedIcon()->SizeInPixels().iHeight > 0 &&
   375 			aFeedInfo.FeedIcon()->SizeInPixels().iWidth > 0)
   371 			aFeedInfo.FeedIcon()->SizeInPixels().iWidth > 0)
   376 		{
   372 		{
   377 		// Hopefully temporary haxx to prevent double delete. I would prefer if
   373 		// Hopefully temporary haxx to prevent double delete. I would prefer if
   378 		// this could be solved with a little better design.
   374 		// this could be solved with a little better design.