]> git.sesse.net Git - vlc/commitdiff
Qt: EPGItem: only update() if data changed
authorFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 30 Mar 2011 17:39:39 +0000 (19:39 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 30 Mar 2011 22:09:35 +0000 (00:09 +0200)
modules/gui/qt4/components/epg/EPGItem.cpp

index de5c9b634bd3a870ea8a6dd6f2f4e7caac9c9c7a..68fc874e93fd41629a7fcc36bc108127a8e38082 100644 (file)
@@ -141,13 +141,25 @@ void EPGItem::setRow( unsigned int i_row_ )
 
 void EPGItem::setData( vlc_epg_event_t *data )
 {
-    m_start = QDateTime::fromTime_t( data->i_start );
-    m_name = qfu( data->psz_name );
-    setToolTip( qfu( data->psz_name ) );
-    m_description = qfu( data->psz_description );
-    m_shortDescription = qfu( data->psz_short_description );
-    setDuration( data->i_duration );
-    update();
+    QDateTime newtime = QDateTime::fromTime_t( data->i_start );
+    QString newname = qfu( data->psz_name );
+    QString newdesc = qfu( data->psz_description );
+    QString newshortdesc = qfu( data->psz_short_description );
+
+    if ( m_start != newtime ||
+         m_name != newname ||
+         m_description != newdesc ||
+         m_shortDescription != newshortdesc ||
+         m_duration != data->i_duration )
+    {
+        m_start = newtime;
+        m_name = newname;
+        setToolTip( newname );
+        m_description = newdesc;
+        m_shortDescription = newshortdesc;
+        setDuration( data->i_duration );
+        update();
+    }
 }
 
 void EPGItem::setCurrent( bool b_current )