Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
authorteknolog
Wed, 26 May 2010 15:30:38 +0100
changeset 134 46baf9a7cadd
parent 133 5f9e7e14eb11
child 137 eefed4bda2e2
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
application/data/PodcastClient_english.rls
application/data/PodcastStrings.ra
application/group/Podcast.mmp
application/src/PodcastShowsView.cpp
engine/group/engine.mmp
engine/src/PodcastModel.cpp
engine/src/ShowEngine.cpp
--- a/application/data/PodcastClient_english.rls	Wed May 26 13:13:30 2010 +0100
+++ b/application/data/PodcastClient_english.rls	Wed May 26 15:30:38 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"
 
 // Download queue operations
 rls_string STRING_r_suspend_download_cmd "Suspend"
--- a/application/data/PodcastStrings.ra	Wed May 26 13:13:30 2010 +0100
+++ b/application/data/PodcastStrings.ra	Wed May 26 15:30:38 2010 +0100
@@ -75,3 +75,4 @@
 RESOURCE TBUF r_reset_db_query {buf = STRING_r_podcast_setting_reset_db_query;}
 
 RESOURCE TBUF r_error_disk_full {buf = STRING_r_error_disk_full; }
+RESOURCE TBUF r_error_playback_failed {buf = STRING_r_error_playback_failed; }
--- a/application/group/Podcast.mmp	Wed May 26 13:13:30 2010 +0100
+++ b/application/group/Podcast.mmp	Wed May 26 15:30:38 2010 +0100
@@ -20,7 +20,7 @@
 TARGETTYPE  	exe
 UID				0x100039CE 0xA0009D00  
 
-CAPABILITY NetworkServices UserEnvironment
+CAPABILITY NetworkServices UserEnvironment WriteUserData ReadDeviceData WriteDeviceData MultimediaDD
 
 EPOCSTACKSIZE 81920
 EPOCHEAPSIZE 1024000 32768000
--- a/application/src/PodcastShowsView.cpp	Wed May 26 13:13:30 2010 +0100
+++ b/application/src/PodcastShowsView.cpp	Wed May 26 15:30:38 2010 +0100
@@ -338,8 +338,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/group/engine.mmp	Wed May 26 13:13:30 2010 +0100
+++ b/engine/group/engine.mmp	Wed May 26 15:30:38 2010 +0100
@@ -73,4 +73,4 @@
 LIBRARY apparc.lib
 LIBRARY avkon.lib
 
-CAPABILITY NetworkServices UserEnvironment
+CAPABILITY All -TCB
--- a/engine/src/PodcastModel.cpp	Wed May 26 13:13:30 2010 +0100
+++ b/engine/src/PodcastModel.cpp	Wed May 26 15:30:38 2010 +0100
@@ -234,6 +234,7 @@
 
 EXPORT_C void CPodcastModel::PlayPausePodcastL(CShowInfo* aPodcast, TBool /* aPlayOnInit */) 
 	{
+	DP("CPodcastModel::PlayPausePodcastL BEGIN");
 	TRAPD(err, LaunchFileEmbeddedL(aPodcast->FileName()));
 	
 	if (err == KErrNone)
@@ -241,7 +242,11 @@
 		aPodcast->SetPlayState(EPlayed);
 		iShowEngine->UpdateShowL(*aPodcast);
 		}
-	
+	else
+		{
+		User::Leave(err);
+		}
+	DP("CPodcastModel::PlayPausePodcastL END");
 	}
 
 EXPORT_C CFeedInfo* CPodcastModel::ActiveFeedInfo()
--- a/engine/src/ShowEngine.cpp	Wed May 26 13:13:30 2010 +0100
+++ b/engine/src/ShowEngine.cpp	Wed May 26 15:30:38 2010 +0100
@@ -857,7 +857,7 @@
 	descPtr.Copy(aItem.Description());
 	PodcastUtils::SQLEncode(descPtr);
 
-	_LIT(KSqlStatement, "update shows set url=\"%S\", title=\"%S\", description=\"%S\", filename=\"%S\", position=\"%Lu\" playtime=\"%u\", playstate=\"%u\", downloadstate=\"%u\", feeduid=\"%u\", showsize=\"%u\", trackno=\"%u\",pubdate=\"%Lu\", showtype=\"%d\", lasterror=\"%d\" where uid=\"%u\"");
+	_LIT(KSqlStatement, "update shows set url=\"%S\", title=\"%S\", description=\"%S\", filename=\"%S\", position=\"%Lu\", playtime=\"%u\", playstate=\"%u\", downloadstate=\"%u\", feeduid=\"%u\", showsize=\"%u\", trackno=\"%u\",pubdate=\"%Lu\", showtype=\"%d\", lasterror=\"%d\" where uid=\"%u\"");
 	iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr,
 			&aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(),
 			aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(),