[vlc-commits] commit: Qt: test if EPG events are the same by also comparing the start time. ( Adrien Maglo )

git at videolan.org git at videolan.org
Tue Jun 15 22:42:58 CEST 2010


vlc | branch: master | Adrien Maglo <magsoft at videolan.org> | Tue Jun 15 22:34:57 2010 +0200| [540bcfd77ea662eee554aeae27b9621c854659db] | committer: Adrien Maglo 

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=540bcfd77ea662eee554aeae27b9621c854659db
---

 modules/gui/qt4/components/epg/EPGWidget.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/components/epg/EPGWidget.cpp b/modules/gui/qt4/components/epg/EPGWidget.cpp
index d62114a..59b5229 100644
--- a/modules/gui/qt4/components/epg/EPGWidget.cpp
+++ b/modules/gui/qt4/components/epg/EPGWidget.cpp
@@ -83,19 +83,22 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg )
             EPGEvent *item = NULL;
             vlc_epg_event_t *p_event = p_epg->pp_event[j];
             QString eventName = qfu( p_event->psz_name );
+            QDateTime eventStart = QDateTime::fromTime_t( p_event->i_start );
 
             QList<EPGEvent*> events = m_events.values( channelName );
 
             for ( int k = 0; k < events.count(); ++k )
             {
                 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->updated = true;
                     item->description = qfu( p_event->psz_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->current = ( p_epg->p_current == p_event ) ? true : false;
 
@@ -112,7 +115,7 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg )
                 item = new EPGEvent( eventName );
                 item->description = qfu( p_event->psz_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->channelName = channelName;
                 item->current = ( p_epg->p_current == p_event ) ? true : false;



More information about the vlc-commits mailing list