Merged show playback error handling from S^3 branch symbian1
authorteknolog
Wed, 26 May 2010 17:46:55 +0100
branchsymbian1
changeset 136 cee38af14bcf
parent 135 2afd8af01d06
child 138 6c8c5122867a
Merged show playback error handling from S^3 branch
application/data/PodcastClient_english.rls
application/data/PodcastStrings.ra
application/src/PodcastShowsView.cpp
engine/src/PodcastModel.cpp
--- a/application/data/PodcastClient_english.rls	Wed May 26 11:30:03 2010 +0100
+++ b/application/data/PodcastClient_english.rls	Wed May 26 17:46:55 2010 +0100
@@ -132,6 +132,7 @@
 rls_string STRING_r_view_download_show_cmd "Get"
 rls_string STRING_r_view_delete_show_cmd "Delete"
 rls_string STRING_r_view_show_info_cmd "Info"
+rls_string STRING_r_error_playback_failed "Could not play show"
 rls_string STRING_r_view_filter_shows_cmd "Show"
 rls_string STRING_r_view_filter_all_shows_cmd "All shows"
 rls_string STRING_r_view_filter_new_shows_cmd "Show new"
--- a/application/data/PodcastStrings.ra	Wed May 26 11:30:03 2010 +0100
+++ b/application/data/PodcastStrings.ra	Wed May 26 17:46:55 2010 +0100
@@ -76,4 +76,5 @@
 
 RESOURCE TBUF r_error_disk_full {buf = STRING_r_error_disk_full; }
 RESOURCE TBUF r_about_text {buf = STRING_r_about_text_s60;}
+RESOURCE TBUF r_error_playback_failed {buf = STRING_r_error_playback_failed; }
 
--- a/application/src/PodcastShowsView.cpp	Wed May 26 11:30:03 2010 +0100
+++ b/application/src/PodcastShowsView.cpp	Wed May 26 17:46:55 2010 +0100
@@ -337,8 +337,16 @@
 					((CPodcastAppUi*)AppUi())->SetActiveTab(KTabIdQueue);
 					break;
 				case EDownloaded:
-					iPodcastModel.PlayPausePodcastL(showInfo, ETrue);
+					{
+					TRAPD(err, iPodcastModel.PlayPausePodcastL(showInfo, ETrue));
+					if (err != KErrNone)
+						{
+						HBufC *error = iEikonEnv->AllocReadResourceLC(R_ERROR_PLAYBACK_FAILED);
+						ShowErrorMessageL(*error);
+						CleanupStack::PopAndDestroy(error);
+						}
 					UpdateListboxItemsL();
+					}
 					break;
 				default:
 					break;
--- a/engine/src/PodcastModel.cpp	Wed May 26 11:30:03 2010 +0100
+++ b/engine/src/PodcastModel.cpp	Wed May 26 17:46:55 2010 +0100
@@ -228,6 +228,7 @@
 
 EXPORT_C void CPodcastModel::PlayPausePodcastL(CShowInfo* aPodcast, TBool aPlayOnInit) 
 	{
+	DP("CPodcastModel::PlayPausePodcastL BEGIN");
 	TRAPD(err, LaunchFileEmbeddedL(aPodcast->FileName()));
 	
 	if (err == KErrNone)
@@ -235,7 +236,11 @@
 		aPodcast->SetPlayState(EPlayed);
 		iShowEngine->UpdateShowL(*aPodcast);
 		}
-	
+	else
+		{
+		User::Leave(err);
+		}
+	DP("CPodcastModel::PlayPausePodcastL END");
 	}
 
 EXPORT_C CFeedInfo* CPodcastModel::ActiveFeedInfo()