engine/src/FeedEngine.cpp
changeset 102 ee650bbb958e
parent 93 c2f1ea38ec70
child 108 3402b2e2a66a
equal deleted inserted replaced
101:68b48f53a8ec 102:ee650bbb958e
   376 	HBufC* descBuf = HBufC::NewLC(KMaxLineLength);
   376 	HBufC* descBuf = HBufC::NewLC(KMaxLineLength);
   377 	TPtr descPtr(descBuf->Des());
   377 	TPtr descPtr(descBuf->Des());
   378 	descPtr.Copy(aItem.Description());
   378 	descPtr.Copy(aItem.Description());
   379 	PodcastUtils::SQLEncode(descPtr);
   379 	PodcastUtils::SQLEncode(descPtr);
   380 	
   380 	
   381 	_LIT(KSqlStatement, "insert into feeds (url, title, description, imageurl, imagefile, link, built, lastupdated, uid, feedtype, customtitle, lasterror)"
   381 	_LIT(KSqlStatement, "insert into feeds (url, title, description, imageurl, imagefile, link, built, lastupdated, uid, feedtype, customtitle, lasterror) values (\"%S\",\"%S\", \"%S\", \"%S\", \"%S\", \"%S\", \"%Ld\", \"%Ld\", \"%u\", \"%u\", \"%u\", \"%d\")");
   382 			" values (\"%S\",\"%S\", \"%S\", \"%S\", \"%S\", \"%S\", \"%Ld\", \"%Ld\", \"%u\", \"%u\", \"%u\", \"%d\")");
       
   383 	iSqlBuffer.Format(KSqlStatement,
   382 	iSqlBuffer.Format(KSqlStatement,
   384 			&aItem.Url(), titleBuf, descBuf, &aItem.ImageUrl(), &aItem.ImageFileName(), &aItem.Link(),
   383 			&aItem.Url(), titleBuf, descBuf, &aItem.ImageUrl(), &aItem.ImageFileName(), &aItem.Link(),
   385 			aItem.BuildDate().Int64(), aItem.LastUpdated().Int64(), aItem.Uid(), EAudioPodcast, aItem.CustomTitle(), aItem.LastError());
   384 			aItem.BuildDate().Int64(), aItem.LastUpdated().Int64(), aItem.Uid(), EAudioPodcast, aItem.CustomTitle(), aItem.LastError());
   386 
   385 
   387 	CleanupStack::PopAndDestroy(descBuf);
   386 	CleanupStack::PopAndDestroy(descBuf);
   489 	HBufC* descBuf = HBufC::NewLC(KMaxLineLength);
   488 	HBufC* descBuf = HBufC::NewLC(KMaxLineLength);
   490 	TPtr descPtr(descBuf->Des());
   489 	TPtr descPtr(descBuf->Des());
   491 	descPtr.Copy(aItem.Description());
   490 	descPtr.Copy(aItem.Description());
   492 	PodcastUtils::SQLEncode(descPtr);
   491 	PodcastUtils::SQLEncode(descPtr);
   493 	
   492 	
   494 	_LIT(KSqlStatement, "update feeds set url=\"%S\", title=\"%S\", description=\"%S\", imageurl=\"%S\", imagefile=\"%S\"," \
   493 	_LIT(KSqlStatement, "update feeds set url=\"%S\", title=\"%S\", description=\"%S\", imageurl=\"%S\", imagefile=\"%S\", link=\"%S\", built=\"%Lu\", lastupdated=\"%Lu\", feedtype=\"%u\", customtitle=\"%u\", lasterror=\"%d\" where uid=\"%u\"");
   495 			"link=\"%S\", built=\"%Lu\", lastupdated=\"%Lu\", feedtype=\"%u\", customtitle=\"%u\", lasterror=\"%d\" where uid=\"%u\"");
       
   496 	iSqlBuffer.Format(KSqlStatement,
   494 	iSqlBuffer.Format(KSqlStatement,
   497 			&aItem.Url(), titleBuf, descBuf, &aItem.ImageUrl(), &aItem.ImageFileName(), &aItem.Link(),
   495 			&aItem.Url(), titleBuf, descBuf, &aItem.ImageUrl(), &aItem.ImageFileName(), &aItem.Link(),
   498 			aItem.BuildDate().Int64(), aItem.LastUpdated().Int64(), EAudioPodcast, aItem.CustomTitle(), aItem.LastError(), aItem.Uid());
   496 			aItem.BuildDate().Int64(), aItem.LastUpdated().Int64(), EAudioPodcast, aItem.CustomTitle(), aItem.LastError(), aItem.Uid());
   499 
   497 
   500 	CleanupStack::PopAndDestroy(descBuf);
   498 	CleanupStack::PopAndDestroy(descBuf);