changeset 152 | 3402b2e2a66a |
parent 141 | ee650bbb958e |
child 172 | c2a99fe1afd0 |
151:17da6d3a5a4b | 152:3402b2e2a66a |
---|---|
355 return ETrue; |
355 return ETrue; |
356 } |
356 } |
357 |
357 |
358 void CFeedEngine::DBAddFeedL(const CFeedInfo& aItem) |
358 void CFeedEngine::DBAddFeedL(const CFeedInfo& aItem) |
359 { |
359 { |
360 DP2("CFeedEngine::DBAddFeed, title=%S, URL=%S", &aItem.Title(), &aItem.Url()); |
360 DP2("CFeedEngine::DBAddFeed BEGIN, title=%S, URL=%S", &aItem.Title(), &aItem.Url()); |
361 |
361 |
362 CFeedInfo *info; |
362 CFeedInfo *info; |
363 |
363 |
364 TRAPD(err, info = DBGetFeedInfoByUidL(aItem.Uid())); |
364 TRAPD(err, info = DBGetFeedInfoByUidL(aItem.Uid())); |
365 |
365 |
403 } |
403 } |
404 else |
404 else |
405 { |
405 { |
406 User::Leave(KErrCorrupt); |
406 User::Leave(KErrCorrupt); |
407 } |
407 } |
408 DP("CFeedEngine::DBAddFeed END"); |
|
408 } |
409 } |
409 |
410 |
410 EXPORT_C void CFeedEngine::RemoveFeedL(TUint aUid) |
411 EXPORT_C void CFeedEngine::RemoveFeedL(TUint aUid) |
411 { |
412 { |
412 if (iActiveFeed && iActiveFeed->Uid() == aUid) |
413 if (iActiveFeed && iActiveFeed->Uid() == aUid) |
448 } |
449 } |
449 |
450 |
450 |
451 |
451 void CFeedEngine::DBRemoveFeedL(TUint aUid) |
452 void CFeedEngine::DBRemoveFeedL(TUint aUid) |
452 { |
453 { |
453 DP("CFeedEngine::DBRemoveFeed"); |
454 DP("CFeedEngine::DBRemoveFeed BEGIN"); |
454 _LIT(KSqlStatement, "delete from feeds where uid=%u"); |
455 _LIT(KSqlStatement, "delete from feeds where uid=%u"); |
455 iSqlBuffer.Format(KSqlStatement, aUid); |
456 iSqlBuffer.Format(KSqlStatement, aUid); |
456 |
457 |
457 sqlite3_stmt *st; |
458 sqlite3_stmt *st; |
458 |
459 |
472 } |
473 } |
473 else |
474 else |
474 { |
475 { |
475 User::Leave(KErrCorrupt); |
476 User::Leave(KErrCorrupt); |
476 } |
477 } |
478 DP("CFeedEngine::DBRemoveFeed END"); |
|
477 } |
479 } |
478 |
480 |
479 void CFeedEngine::DBUpdateFeedL(const CFeedInfo &aItem) |
481 void CFeedEngine::DBUpdateFeedL(const CFeedInfo &aItem) |
480 { |
482 { |
481 DP2("CFeedEngine::DBUpdateFeed, title=%S, URL=%S", &aItem.Title(), &aItem.Url()); |
483 DP2("CFeedEngine::DBUpdateFeed BEGIN, title=%S, URL=%S", &aItem.Title(), &aItem.Url()); |
482 |
484 |
483 HBufC* titleBuf = HBufC::NewLC(KMaxLineLength); |
485 HBufC* titleBuf = HBufC::NewLC(KMaxLineLength); |
484 TPtr titlePtr(titleBuf->Des()); |
486 TPtr titlePtr(titleBuf->Des()); |
485 titlePtr.Copy(aItem.Title()); |
487 titlePtr.Copy(aItem.Title()); |
486 PodcastUtils::SQLEncode(titlePtr); |
488 PodcastUtils::SQLEncode(titlePtr); |
515 } |
517 } |
516 else |
518 else |
517 { |
519 { |
518 User::Leave(KErrCorrupt); |
520 User::Leave(KErrCorrupt); |
519 } |
521 } |
522 DP("CFeedEngine::DBUpdateFeed END"); |
|
520 } |
523 } |
521 |
524 |
522 void CFeedEngine::ParsingCompleteL(CFeedInfo *item) |
525 void CFeedEngine::ParsingCompleteL(CFeedInfo *item) |
523 { |
526 { |
524 TBuf<KMaxLineLength> title; |
527 TBuf<KMaxLineLength> title; |
996 DP("DBLoadFeeds END"); |
999 DP("DBLoadFeeds END"); |
997 } |
1000 } |
998 |
1001 |
999 CFeedInfo* CFeedEngine::DBGetFeedInfoByUidL(TUint aFeedUid) |
1002 CFeedInfo* CFeedEngine::DBGetFeedInfoByUidL(TUint aFeedUid) |
1000 { |
1003 { |
1001 DP("CFeedEngine::DBGetFeedInfoByUid"); |
1004 DP("CFeedEngine::DBGetFeedInfoByUid BEGIN"); |
1002 CFeedInfo *feedInfo = NULL; |
1005 CFeedInfo *feedInfo = NULL; |
1003 _LIT(KSqlStatement, "select url, title, description, imageurl, imagefile, link, built, lastupdated, uid, feedtype, customtitle, lasterror from feeds where uid=%u"); |
1006 _LIT(KSqlStatement, "select url, title, description, imageurl, imagefile, link, built, lastupdated, uid, feedtype, customtitle, lasterror from feeds where uid=%u"); |
1004 iSqlBuffer.Format(KSqlStatement, aFeedUid); |
1007 iSqlBuffer.Format(KSqlStatement, aFeedUid); |
1005 |
1008 |
1006 sqlite3_stmt *st; |
1009 sqlite3_stmt *st; |
1065 } |
1068 } |
1066 else |
1069 else |
1067 { |
1070 { |
1068 User::Leave(KErrNotFound); |
1071 User::Leave(KErrNotFound); |
1069 } |
1072 } |
1070 |
1073 DP("CFeedEngine::DBGetFeedInfoByUid END"); |
1071 return feedInfo; |
1074 return feedInfo; |
1072 } |
1075 } |
1073 |
1076 |
1074 EXPORT_C void CFeedEngine::UpdateFeedInfoL(CFeedInfo *aItem) |
1077 EXPORT_C void CFeedEngine::UpdateFeedInfoL(CFeedInfo *aItem) |
1075 { |
1078 { |