Commit 540bcfd7 authored by Adrien Maglo's avatar Adrien Maglo

Qt: test if EPG events are the same by also comparing the start time.

parent c4ffaad9
...@@ -83,19 +83,22 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg ) ...@@ -83,19 +83,22 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg )
EPGEvent *item = NULL; EPGEvent *item = NULL;
vlc_epg_event_t *p_event = p_epg->pp_event[j]; vlc_epg_event_t *p_event = p_epg->pp_event[j];
QString eventName = qfu( p_event->psz_name ); QString eventName = qfu( p_event->psz_name );
QDateTime eventStart = QDateTime::fromTime_t( p_event->i_start );
QList<EPGEvent*> events = m_events.values( channelName ); QList<EPGEvent*> events = m_events.values( channelName );
for ( int k = 0; k < events.count(); ++k ) for ( int k = 0; k < events.count(); ++k )
{ {
if ( events.at( k )->name == eventName && if ( events.at( k )->name == eventName &&
events.at( k )->channelName == channelName ) events.at( k )->channelName == channelName &&
events.at( k )->start == eventStart )
{ {
/* Update the event. */
item = events.at( k ); item = events.at( k );
item->updated = true; item->updated = true;
item->description = qfu( p_event->psz_description ); item->description = qfu( p_event->psz_description );
item->shortDescription = qfu( p_event->psz_short_description ); item->shortDescription = qfu( p_event->psz_short_description );
item->start = QDateTime::fromTime_t( p_event->i_start ); item->start = eventStart;
item->duration = p_event->i_duration; item->duration = p_event->i_duration;
item->current = ( p_epg->p_current == p_event ) ? true : false; item->current = ( p_epg->p_current == p_event ) ? true : false;
...@@ -112,7 +115,7 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg ) ...@@ -112,7 +115,7 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg )
item = new EPGEvent( eventName ); item = new EPGEvent( eventName );
item->description = qfu( p_event->psz_description ); item->description = qfu( p_event->psz_description );
item->shortDescription = qfu( p_event->psz_short_description ); item->shortDescription = qfu( p_event->psz_short_description );
item->start = QDateTime::fromTime_t( p_event->i_start ); item->start = eventStart;
item->duration = p_event->i_duration; item->duration = p_event->i_duration;
item->channelName = channelName; item->channelName = channelName;
item->current = ( p_epg->p_current == p_event ) ? true : false; item->current = ( p_epg->p_current == p_event ) ? true : false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment