# HG changeset patch # User teknolog # Date 1267115243 0 # Node ID ba42cd6670b87756b7cc0dfb37afc504ec52fb34 # Parent be243543a3619ba29fc6abd5eaf5039aa1028a1e Cleanup of command handling code diff -r be243543a361 -r ba42cd6670b8 application/inc/PodcastFeedView.h --- a/application/inc/PodcastFeedView.h Thu Feb 25 16:02:42 2010 +0000 +++ b/application/inc/PodcastFeedView.h Thu Feb 25 16:27:23 2010 +0000 @@ -104,6 +104,7 @@ void HandleImportFeedsL(); void HandleExportFeedsL(); void HandleUpdateFeedL(); + void GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode); private: CPodcastModel& iPodcastModel; diff -r be243543a361 -r ba42cd6670b8 application/inc/PodcastShowsView.h --- a/application/inc/PodcastShowsView.h Thu Feb 25 16:02:42 2010 +0000 +++ b/application/inc/PodcastShowsView.h Thu Feb 25 16:27:23 2010 +0000 @@ -109,8 +109,8 @@ * image was loaded successfully. */ virtual void ImageOperationCompleteL(TInt aError); - void SetShowPlayed(TBool aPlayed); - void DeleteShow(); + void HandleSetShowPlayed(TBool aPlayed); + void HandleDeleteShow(); void UpdateViewTitleL(); void CreateIconsL(); void GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode); diff -r be243543a361 -r ba42cd6670b8 application/src/PodcastFeedView.cpp --- a/application/src/PodcastFeedView.cpp Thu Feb 25 16:02:42 2010 +0000 +++ b/application/src/PodcastFeedView.cpp Thu Feb 25 16:27:23 2010 +0000 @@ -376,6 +376,11 @@ } } + if(aFeedInfo.LastError() != KErrNone) + { + GetFeedErrorText(unplayedShows, aFeedInfo.LastError()); + } + if (unplayedShows.Length() > 0) { unplayedShows.Insert(0,_L(", ")); } @@ -916,3 +921,8 @@ { iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); } + +void CPodcastFeedView::GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode) + { + iEikonEnv->GetErrorText(aErrorMessage, aErrorCode); + } diff -r be243543a361 -r ba42cd6670b8 application/src/PodcastShowsView.cpp --- a/application/src/PodcastShowsView.cpp Thu Feb 25 16:02:42 2010 +0000 +++ b/application/src/PodcastShowsView.cpp Thu Feb 25 16:27:23 2010 +0000 @@ -45,7 +45,7 @@ _LIT(KSizeDownloadingOf, "%.1f/%.1f MB"); _LIT(KShowsSizeFormatS60, "%.1f MB"); -_LIT(KShowFormat, "%d\t%S\t%S %S\t"); +_LIT(KShowFormat, "%d\t%S\t%S%S\t"); _LIT(KShowErrorFormat, "%d\t%S\t%S\t"); _LIT(KShowQueueFormat, "%d\t%S\t%S%S\t"); @@ -592,17 +592,17 @@ switch (aCommand) { case EPodcastMarkAsPlayed: - SetShowPlayed(ETrue); + HandleSetShowPlayed(ETrue); break; case EPodcastMarkAsUnplayed: - SetShowPlayed(EFalse); + HandleSetShowPlayed(EFalse); break; case EPodcastMarkAllPlayed: iPodcastModel.MarkSelectionPlayed(); UpdateListboxItemsL(); break; case EPodcastDeleteShow: - DeleteShow(); + HandleDeleteShow(); break; case EPodcastDownloadShow: { @@ -623,8 +623,7 @@ if (error != KErrNone) { - HBufC - * str = + HBufC* str = iEikonEnv->AllocReadResourceLC(R_PODCAST_FEEDS_UPDATE_ERROR); User::InfoPrint(*str); CleanupStack::PopAndDestroy(str); @@ -823,7 +822,7 @@ DP("CPodcastShowsView::HandleLongTapEventL END"); } -void CPodcastShowsView::SetShowPlayed(TBool aPlayed) +void CPodcastShowsView::HandleSetShowPlayed(TBool aPlayed) { TInt index = iListContainer->Listbox()->CurrentItemIndex(); @@ -838,7 +837,7 @@ } } -void CPodcastShowsView::DeleteShow() +void CPodcastShowsView::HandleDeleteShow() { TInt index = iListContainer->Listbox()->CurrentItemIndex();