equal
deleted
inserted
replaced
517 void CShowEngine::DBGetOldShowsL(RShowInfoArray& aShowArray) |
517 void CShowEngine::DBGetOldShowsL(RShowInfoArray& aShowArray) |
518 { |
518 { |
519 DP("CShowEngine::DBGetOldShowsL BEGIN"); |
519 DP("CShowEngine::DBGetOldShowsL BEGIN"); |
520 TTime now; |
520 TTime now; |
521 now.HomeTime(); |
521 now.HomeTime(); |
522 _LIT(KSqlStatement, "select filename, deletedate shows where deletedate < %Ld"); |
522 // TTimeIntervalYears years(5); |
523 iSqlBuffer.Format(KSqlStatement, now.Int64()); |
523 // now += years; |
|
524 |
|
525 _LIT(KSqlStatement, "select filename from shows where downloadstate=%d and deletedate < \"%Ld\""); |
|
526 iSqlBuffer.Format(KSqlStatement, EDownloaded, now.Int64()); |
524 |
527 |
525 sqlite3_stmt *st; |
528 sqlite3_stmt *st; |
526 |
529 |
527 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
530 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
528 &st, (const void**) NULL); |
531 &st, (const void**) NULL); |
533 Cleanup_sqlite3_finalize_PushL(st); |
536 Cleanup_sqlite3_finalize_PushL(st); |
534 while (rc == SQLITE_ROW) |
537 while (rc == SQLITE_ROW) |
535 { |
538 { |
536 CShowInfo* showInfo = CShowInfo::NewLC(); |
539 CShowInfo* showInfo = CShowInfo::NewLC(); |
537 |
540 |
538 const void *filez = sqlite3_column_text16(st, 3); |
541 const void *filez = sqlite3_column_text16(st, 0); |
539 TPtrC16 file((const TUint16*) filez); |
542 TPtrC16 file((const TUint16*) filez); |
540 showInfo->SetFileNameL(file); |
543 showInfo->SetFileNameL(file); |
541 |
|
542 sqlite3_int64 deletedate = sqlite3_column_int64(st, 15); |
|
543 TTime timedeletedate(deletedate); |
|
544 showInfo->SetDeleteDate(timedeletedate); |
|
545 |
544 |
546 aShowArray.Append(showInfo); |
545 aShowArray.Append(showInfo); |
547 CleanupStack::Pop(showInfo); |
546 CleanupStack::Pop(showInfo); |
548 rc = sqlite3_step(st); |
547 rc = sqlite3_step(st); |
549 } |
548 } |