# HG changeset patch # User Sebastian Brannstrom # Date 1279225749 -3600 # Node ID 913f0f0e98fc2f1eebc536ccc742961366a75282 # Parent 828b50176e56eebd339529d78eca7c762ed1cb1a Fix so listbox position is kept when removing a show from queue diff -r 828b50176e56 -r 913f0f0e98fc application/inc/PodcastQueueView.h --- a/application/inc/PodcastQueueView.h Thu Jul 15 20:42:25 2010 +0100 +++ b/application/inc/PodcastQueueView.h Thu Jul 15 21:29:09 2010 +0100 @@ -80,6 +80,9 @@ void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation); + +private: + TBool iDontUpdateList; }; #endif diff -r 828b50176e56 -r 913f0f0e98fc application/src/PodcastQueueView.cpp --- a/application/src/PodcastQueueView.cpp Thu Jul 15 20:42:25 2010 +0100 +++ b/application/src/PodcastQueueView.cpp Thu Jul 15 21:29:09 2010 +0100 @@ -155,7 +155,7 @@ void CPodcastQueueView::UpdateListboxItemsL() { - if (iListContainer->IsVisible()) + if (iListContainer->IsVisible() && !iDontUpdateList) { TListItemProperties itemProps; TInt len = 0; @@ -249,7 +249,17 @@ TInt index = iListContainer->Listbox()->CurrentItemIndex(); if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) { + // this is an ugly hack to prevent UpdateListboxItemsL from being + // triggered from the show engine, which causes focus to jump + // around in an ugly fashion + iDontUpdateList = ETrue; TRAP_IGNORE(iPodcastModel.ShowEngine().RemoveDownloadL(iPodcastModel.ActiveShowList()[index]->Uid())); + iDontUpdateList = EFalse; + } + UpdateListboxItemsL(); + if (index > 0) + { + iListContainer->Listbox()->SetCurrentItemIndex(index - 1); } } break;