engine/src/ShowEngine.cpp
branchsymbian1
changeset 130 92572a695a1d
parent 67 9c24c921ec35
child 147 2e626f5a52c8
--- a/engine/src/ShowEngine.cpp	Tue May 25 00:31:01 2010 +0100
+++ b/engine/src/ShowEngine.cpp	Tue May 25 00:33:50 2010 +0100
@@ -540,6 +540,23 @@
 	_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where feeduid=%u");
 	iSqlBuffer.Format(KSqlStatement, aFeedUid);
 
+	if (iShowFilter == ENewShows)
+		{
+		_LIT(KSqlStatementNewShows, " and playstate = 0"); // ENeverPlayed
+		iSqlBuffer.Append(KSqlStatementNewShows);
+		}
+	else if (iShowFilter == EDownloadedShows)
+		{
+	_LIT(KSqlStatementDownloadedShows, " and downloadstate = 4"); // EDownloaded
+		iSqlBuffer.Append(KSqlStatementDownloadedShows);
+		}
+	else if (iShowFilter == ENewAndDownloadedShows)
+		{
+	_LIT(KSqlStatementDownloadedAndNewShows, " and (downloadstate = 4 or playstate = 0)"); // EDownloaded or ENeverPlayed
+		iSqlBuffer.Append(KSqlStatementDownloadedAndNewShows);
+	
+		}
+	
 #ifndef DONT_SORT_SQL	
 	_LIT(KSqlOrderByDate, " order by pubdate desc");
 	iSqlBuffer.Append(KSqlOrderByDate);
@@ -1387,3 +1404,7 @@
 		}
 	}
 
+EXPORT_C void CShowEngine::SetShowFilter(TShowFilter aFilter)
+	{
+	iShowFilter = aFilter;
+	}