CNeutrinoEventList::findEvents - remove events for not found channels in channelList

Origin commit data
------------------
Commit: 5869af605b
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2013-05-15 (Wed, 15 May 2013)

Origin message was:
------------------
 CNeutrinoEventList::findEvents - remove events for not found channels in channelList
This commit is contained in:
Jacek Jendrzej
2013-05-15 17:36:33 +02:00
parent 1c4b455438
commit 51dbfc1010

View File

@@ -1061,24 +1061,29 @@ bool CNeutrinoEventList::findEvents(void)
box.paint(); box.paint();
std::vector<t_channel_id> v; std::vector<t_channel_id> v;
int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio
for(int channel = 0; channel < channel_nr; channel++) for(int channel = 0; channel < channel_nr; channel++){
{
channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id; channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id;
v.push_back(channel_id); v.push_back(channel_id);
} }
std::map<t_channel_id, t_channel_id > ch_id_map; std::map<t_channel_id, t_channel_id> ch_id_map;
std::vector<t_channel_id>::iterator it; std::vector<t_channel_id>::iterator it;
for (it = v.begin(); it != v.end(); ++it) for (it = v.begin(); it != v.end(); ++it){
{
ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it;
} }
CEitManager::getInstance()->getEventsServiceKey(1/*hack*/,evtlist, m_search_epg_item,m_search_keyword); CEitManager::getInstance()->getEventsServiceKey(1/*hack*/,evtlist, m_search_epg_item,m_search_keyword);
std::map<t_channel_id, t_channel_id>::iterator map_it;
CChannelEventList::iterator e; CChannelEventList::iterator e;
for ( e=evtlist.begin(); e!=evtlist.end(); ++e ) for ( e=evtlist.begin(); e!=evtlist.end();){
{ map_it = ch_id_map.find(e->channelID);
if(e->channelID) if (map_it != ch_id_map.end()){
e->channelID = ch_id_map[e->channelID];//map channelID48 to channelID64 e->channelID = map_it->second;//map channelID48 to channelID
++e;
}
else{
evtlist.erase(e);// remove event for not found channels in channelList
}
} }
box.hide(); box.hide();
} }