engine/src/ShowEngine.cpp
branchsymbian1
changeset 381 29e277559820
parent 375 82f59b3393b3
child 385 f372a154ba57
--- a/engine/src/ShowEngine.cpp	Fri Nov 19 22:52:12 2010 +0000
+++ b/engine/src/ShowEngine.cpp	Fri Nov 19 22:52:50 2010 +0000
@@ -554,6 +554,23 @@
 		{
 		User::Leave(KErrCorrupt);
 		}
+	
+	// now update DB
+	_LIT(KSqlStatement2, "update shows set downloadstate=%d and deletedate = 0 where downloadstate=%d and deletedate != 0 and deletedate < \"%Ld\"");
+	iSqlBuffer.Format(KSqlStatement2, ENotDownloaded, EDownloaded, now.Int64());
+
+
+	rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1,
+			&st, (const void**) NULL);
+
+	if (rc == SQLITE_OK)
+		{
+		rc = sqlite3_step(st);
+		Cleanup_sqlite3_finalize_PushL(st);
+		CleanupStack::PopAndDestroy();//st
+		}
+
+	
 	DP("CShowEngine::DBGetOldShowsL END");
 	}
 
@@ -1680,6 +1697,7 @@
 		deleteDate.HomeTime();
 		deleteDate += daysAhead;
 		aShow->SetDeleteDate(deleteDate);
+		DP2("Setting show %S to be deleted on the %d th", &aShow->Title(), deleteDate.DayNoInMonth());
 		}
 	
 	UpdateShowL(*aShow);