From 3be2cb060c30581bd1c59c72a90b0d0c3f79bd45 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sun, 13 Jan 2008 13:46:22 +0100 Subject: - code for collecting and displaying EPG events in 'What's on' is now separated --- epgsearch.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'epgsearch.cpp') diff --git a/epgsearch.cpp b/epgsearch.cpp index e905bd9..622ef21 100644 --- a/epgsearch.cpp +++ b/epgsearch.cpp @@ -557,10 +557,10 @@ Blacklists::Blacklists() SearchResult::SearchResult( string const& data ) { - vector< string > parts = StringSplit( data, ':' ); - try { - vector< string >::const_iterator part = parts.begin(); - for ( int i = 0; part != parts.end(); ++i, ++part ) { + vector< string > parts = StringSplit( data, ':' ); + try { + vector< string >::const_iterator part = parts.begin(); + for ( int i = 0; part != parts.end(); ++i, ++part ) { switch ( i ) { case 0: m_searchId = lexical_cast< int >( *part ); break; case 1: m_eventId = lexical_cast< u_int32_t >( *part ); break; @@ -580,6 +580,18 @@ SearchResult::SearchResult( string const& data ) } } +const cEvent* SearchResult::GetEvent() +{ + cSchedulesLock schedulesLock; + const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); + if (!Schedules) return NULL; + const cChannel *Channel = GetChannel(); + if (!Channel) return NULL; + const cSchedule *Schedule = Schedules->GetSchedule(Channel); + if (!Schedule) return NULL; + return Schedule->GetEvent(m_eventId); +} + std::set SearchResults::querySet; void SearchResults::GetByID(int id) -- cgit v1.2.3