Cleanup of command handling code
authorteknolog
Thu, 25 Feb 2010 16:27:23 +0000
changeset 5 ba42cd6670b8
parent 4 be243543a361
child 6 e211a78d3037
Cleanup of command handling code
application/inc/PodcastFeedView.h
application/inc/PodcastShowsView.h
application/src/PodcastFeedView.cpp
application/src/PodcastShowsView.cpp
--- 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;		
--- 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);
--- 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);
+	}
--- 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();