application/src/PodcastFeedView.cpp
changeset 36 e010fc411ddc
parent 35 66c5303f3610
parent 33 64ed1227e68d
child 37 1644b7cd063e
child 45 56d4e0784e5d
equal deleted inserted replaced
35:66c5303f3610 36:e010fc411ddc
   187 		// go to shows view
   187 		// go to shows view
   188 		AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID,  TUid::Uid(0), KNullDesC8());
   188 		AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID,  TUid::Uid(0), KNullDesC8());
   189 		} 
   189 		} 
   190 	else 
   190 	else 
   191 		{
   191 		{
       
   192 		UpdateListboxItemsL();		
   192 		UpdateToolbar();
   193 		UpdateToolbar();
   193 
   194 
   194 		if (iFirstActivateAfterLaunch)
   195 		if (iFirstActivateAfterLaunch)
   195 			{
   196 			{
   196 			iFirstActivateAfterLaunch = EFalse;
   197 			iFirstActivateAfterLaunch = EFalse;
   369 			else 
   370 			else 
   370 				{
   371 				{
   371 				aFeedInfo.LastUpdated().FormatL(updatedDate, KDateFormatShort());
   372 				aFeedInfo.LastUpdated().FormatL(updatedDate, KDateFormatShort());
   372 				}
   373 				}
   373 			}
   374 			}
       
   375 		
       
   376 		if(aFeedInfo.LastError() != KErrNone)
       
   377 			{
       
   378 			GetFeedErrorText(unplayedShows, aFeedInfo.LastError());
       
   379 			}
   374 		}
   380 		}
   375 	CArrayPtr<CGulIcon>* icons = iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->IconArray();
   381 	CArrayPtr<CGulIcon>* icons = iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->IconArray();
   376 	
   382 	
   377 	if (aFeedInfo.FeedIconIndex() != -1) {
   383 	if (aFeedInfo.FeedIconIndex() != -1) {
   378 		iconIndex = aFeedInfo.FeedIconIndex();
   384 		iconIndex = aFeedInfo.FeedIconIndex();
   393 			}
   399 			}
   394 		else {
   400 		else {
   395 			if(BaflUtils::FileExists(iPodcastModel.FsSession(), aFeedInfo.ImageFileName()))
   401 			if(BaflUtils::FileExists(iPodcastModel.FsSession(), aFeedInfo.ImageFileName()))
   396 			{
   402 			{
   397 			// If this fails, no reason to worry
   403 			// If this fails, no reason to worry
   398 			TRAP_IGNORE(iPodcastModel.ImageHandler().LoadFileAndScaleL(aFeedInfo.FeedIcon(), aFeedInfo.ImageFileName(), TSize(64,56), *this));
   404 			TRAP_IGNORE(iPodcastModel.ImageHandler().LoadFileAndScaleL(aFeedInfo.FeedIcon(), aFeedInfo.ImageFileName(), TSize(64,56), *this, aFeedInfo.Uid()));
   399 			}
   405 			}
   400 		}
   406 		}
   401 	}
   407 	}
   402 	
   408 	
   403 	if(aFeedInfo.LastError() != KErrNone)
       
   404 		{
       
   405 		GetFeedErrorText(unplayedShows, aFeedInfo.LastError());
       
   406 		}
       
   407 		
       
   408 	if (unplayedShows.Length() > 0) {
   409 	if (unplayedShows.Length() > 0) {
   409 		unplayedShows.Insert(0,_L(", "));
   410 		unplayedShows.Insert(0,_L(", "));
   410 	}
   411 	}
   411 	
   412 	
   412 	iListboxFormatbuffer.Format(KFeedFormat(), iconIndex, &(aFeedInfo.Title()), &updatedDate,  &unplayedShows);
   413 	iListboxFormatbuffer.Format(KFeedFormat(), iconIndex, &(aFeedInfo.Title()), &updatedDate,  &unplayedShows);
   413 	}
   414 	}
   414 
   415 
   415 void CPodcastFeedView::ImageOperationCompleteL(TInt aError)
   416 void CPodcastFeedView::ImageOperationCompleteL(TInt aError, TUint aHandle)
   416 	{
   417 	{
   417 	if (aError == KErrNone) {
   418 	if (aError == KErrNone) {
   418 		UpdateListboxItemsL();
   419 	UpdateFeedInfoStatusL(aHandle, EFalse);
   419 	}
   420 	}
   420 	}
   421 	}
   421 
   422 
   422 void CPodcastFeedView::UpdateFeedInfoDataL(CFeedInfo* aFeedInfo, TInt aIndex, TBool aIsUpdating )
   423 void CPodcastFeedView::UpdateFeedInfoDataL(CFeedInfo* aFeedInfo, TInt aIndex, TBool aIsUpdating )
   423 	{			
   424 	{