engine/src/ShowEngine.cpp
branchsymbian1
changeset 130 92572a695a1d
parent 67 9c24c921ec35
child 147 2e626f5a52c8
equal deleted inserted replaced
129:7ef9faf10a81 130:92572a695a1d
   538 	{
   538 	{
   539 	DP1("CShowEngine::DBGetShowsByFeed BEGIN, feedUid=%u", aFeedUid);
   539 	DP1("CShowEngine::DBGetShowsByFeed BEGIN, feedUid=%u", aFeedUid);
   540 	_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where feeduid=%u");
   540 	_LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where feeduid=%u");
   541 	iSqlBuffer.Format(KSqlStatement, aFeedUid);
   541 	iSqlBuffer.Format(KSqlStatement, aFeedUid);
   542 
   542 
       
   543 	if (iShowFilter == ENewShows)
       
   544 		{
       
   545 		_LIT(KSqlStatementNewShows, " and playstate = 0"); // ENeverPlayed
       
   546 		iSqlBuffer.Append(KSqlStatementNewShows);
       
   547 		}
       
   548 	else if (iShowFilter == EDownloadedShows)
       
   549 		{
       
   550 	_LIT(KSqlStatementDownloadedShows, " and downloadstate = 4"); // EDownloaded
       
   551 		iSqlBuffer.Append(KSqlStatementDownloadedShows);
       
   552 		}
       
   553 	else if (iShowFilter == ENewAndDownloadedShows)
       
   554 		{
       
   555 	_LIT(KSqlStatementDownloadedAndNewShows, " and (downloadstate = 4 or playstate = 0)"); // EDownloaded or ENeverPlayed
       
   556 		iSqlBuffer.Append(KSqlStatementDownloadedAndNewShows);
       
   557 	
       
   558 		}
       
   559 	
   543 #ifndef DONT_SORT_SQL	
   560 #ifndef DONT_SORT_SQL	
   544 	_LIT(KSqlOrderByDate, " order by pubdate desc");
   561 	_LIT(KSqlOrderByDate, " order by pubdate desc");
   545 	iSqlBuffer.Append(KSqlOrderByDate);
   562 	iSqlBuffer.Append(KSqlOrderByDate);
   546 #endif
   563 #endif
   547 
   564 
  1385 				}
  1402 				}
  1386 			}
  1403 			}
  1387 		}
  1404 		}
  1388 	}
  1405 	}
  1389 
  1406 
       
  1407 EXPORT_C void CShowEngine::SetShowFilter(TShowFilter aFilter)
       
  1408 	{
       
  1409 	iShowFilter = aFilter;
       
  1410 	}