application/src/PodcastQueueView.cpp
branchsymbian1
changeset 183 913f0f0e98fc
parent 173 8466fe8528b6
child 263 c71e68f962c6
equal deleted inserted replaced
182:828b50176e56 183:913f0f0e98fc
   153 		UpdateToolbar();
   153 		UpdateToolbar();
   154 	}
   154 	}
   155 
   155 
   156 void CPodcastQueueView::UpdateListboxItemsL()
   156 void CPodcastQueueView::UpdateListboxItemsL()
   157 	{
   157 	{
   158 	if (iListContainer->IsVisible())
   158 	if (iListContainer->IsVisible() && !iDontUpdateList)
   159 		{
   159 		{
   160 		TListItemProperties itemProps;
   160 		TListItemProperties itemProps;
   161 		TInt len = 0;
   161 		TInt len = 0;
   162 
   162 
   163 		iPodcastModel.GetShowsDownloadingL();
   163 		iPodcastModel.GetShowsDownloadingL();
   247 		case EPodcastRemoveDownload:
   247 		case EPodcastRemoveDownload:
   248 			{
   248 			{
   249 			TInt index = iListContainer->Listbox()->CurrentItemIndex();
   249 			TInt index = iListContainer->Listbox()->CurrentItemIndex();
   250 			if (index >= 0 && index < iPodcastModel.ActiveShowList().Count())
   250 			if (index >= 0 && index < iPodcastModel.ActiveShowList().Count())
   251 				{
   251 				{
       
   252 				// this is an ugly hack to prevent UpdateListboxItemsL from being
       
   253 				// triggered from the show engine, which causes focus to jump
       
   254 				// around in an ugly fashion
       
   255 				iDontUpdateList = ETrue;
   252 				TRAP_IGNORE(iPodcastModel.ShowEngine().RemoveDownloadL(iPodcastModel.ActiveShowList()[index]->Uid()));
   256 				TRAP_IGNORE(iPodcastModel.ShowEngine().RemoveDownloadL(iPodcastModel.ActiveShowList()[index]->Uid()));
       
   257 				iDontUpdateList = EFalse;
       
   258 				}
       
   259 			UpdateListboxItemsL();
       
   260 			if (index > 0)
       
   261 				{
       
   262 				iListContainer->Listbox()->SetCurrentItemIndex(index - 1);
   253 				}
   263 				}
   254 			}
   264 			}
   255 			break;
   265 			break;
   256 		case EPodcastMoveDownloadUp:
   266 		case EPodcastMoveDownloadUp:
   257 			{
   267 			{