CEitManager::getEventsServiceKey - simplification - THX Gaucho316

This commit is contained in:
Jacek Jendrzej
2013-06-03 21:37:47 +02:00
parent f201ea2717
commit 09bd2c98e9

View File

@@ -2257,27 +2257,23 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve
bool copy = true;
if(search){
if((search == 1) || (search == 5)) {//SEARCH_EPG_TITLE == 1 SEARCH_EPG_ALL == 5 defined in eventlist.h
if ((search == 1 /*EventList::SEARCH_EPG_TITLE*/) || (search == 5 /*EventList::SEARCH_EPG_ALL*/))
{
std::string eName = (*e)->getName();
std::transform(eName.begin(), eName.end(), eName.begin(), tolower);
if(eName.find(search_text) == std::string::npos)
copy = false;
copy = (eName.find(search_text) != std::string::npos);
}
if((search == 2) || (!copy && search == 5)) {//SEARCH_EPG_INFO1 == 2
if ((search == 2 /*EventList::SEARCH_EPG_INFO1*/) || (!copy && (search == 5 /*EventList::SEARCH_EPG_ALL*/)))
{
std::string eText = (*e)->getText();
std::transform(eText.begin(), eText.end(), eText.begin(), tolower);
if(eText.find(search_text) == std::string::npos)
copy = false;
else if(search == 5)
copy = true;
copy = (eText.find(search_text) != std::string::npos);
}
if((search == 3) || (!copy && search == 5)) {//SEARCH_EPG_INFO2 == 3
if ((search == 3 /*EventList::SEARCH_EPG_INFO2*/) || (!copy && (search == 5 /*EventList::SEARCH_EPG_ALL*/)))
{
std::string eExtendedText = (*e)->getExtendedText();
std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower);
if(eExtendedText.find(search_text) == std::string::npos)
copy = false;
else if(search == 5)
copy = true;
copy = (eExtendedText.find(search_text) != std::string::npos);
}
}
if(copy) {