engine/src/ShowEngine.cpp
changeset 30 7bca37ba5fa9
parent 22 3243c9461520
child 34 a6046405f1aa
child 35 66c5303f3610
equal deleted inserted replaced
29:08733234ccb1 30:7bca37ba5fa9
   806 
   806 
   807 TBool CShowEngine::DBUpdateShow(CShowInfo& aItem)
   807 TBool CShowEngine::DBUpdateShow(CShowInfo& aItem)
   808 	{
   808 	{
   809 	DP1("CShowEngine::DBUpdateShow, title='%S'", &aItem.Title());
   809 	DP1("CShowEngine::DBUpdateShow, title='%S'", &aItem.Title());
   810 
   810 
       
   811 	HBufC* titleBuf = HBufC::NewLC(KMaxLineLength);
       
   812 	TPtr titlePtr(titleBuf->Des());
       
   813 	titlePtr.Copy(aItem.Title());
       
   814 	PodcastUtils::SQLEncode(titlePtr);
       
   815 
       
   816 	HBufC* descBuf = HBufC::NewLC(KMaxLineLength);
       
   817 	TPtr descPtr(descBuf->Des());
       
   818 	descPtr.Copy(aItem.Description());
       
   819 	PodcastUtils::SQLEncode(descPtr);
       
   820 
   811 	_LIT(KSqlStatement, "update shows set url=\"%S\", title=\"%S\", description=\"%S\", filename=\"%S\", position=\"%Lu\","
   821 	_LIT(KSqlStatement, "update shows set url=\"%S\", title=\"%S\", description=\"%S\", filename=\"%S\", position=\"%Lu\","
   812 			"playtime=\"%u\", playstate=\"%u\", downloadstate=\"%u\", feeduid=\"%u\", showsize=\"%u\", trackno=\"%u\","
   822 			"playtime=\"%u\", playstate=\"%u\", downloadstate=\"%u\", feeduid=\"%u\", showsize=\"%u\", trackno=\"%u\","
   813 			"pubdate=\"%Lu\", showtype=\"%d\", lasterror=\"%d\" where uid=\"%u\"");
   823 			"pubdate=\"%Lu\", showtype=\"%d\", lasterror=\"%d\" where uid=\"%u\"");
   814 	iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &aItem.Title(), &aItem.Description(),
   824 	iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr,
   815 			&aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(),
   825 			&aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(),
   816 			aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(),
   826 			aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(),
   817 			aItem.ShowSize(), aItem.TrackNo(), aItem.PubDate().Int64(),
   827 			aItem.ShowSize(), aItem.TrackNo(), aItem.PubDate().Int64(),
   818 			aItem.ShowType(), aItem.LastError(), aItem.Uid());
   828 			aItem.ShowType(), aItem.LastError(), aItem.Uid());
       
   829 
       
   830 	CleanupStack::PopAndDestroy(descBuf);
       
   831 	CleanupStack::PopAndDestroy(titleBuf);
   819 
   832 
   820 	sqlite3_stmt *st;
   833 	sqlite3_stmt *st;
   821 
   834 
   822 	int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1,
   835 	int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1,
   823 			&st, (const void**) NULL);
   836 			&st, (const void**) NULL);