[vlc-commits] commit: Qt/EPG: use a qgraphicsitem_cast instead of dynamic_cast ( Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Wed Jun 16 21:54:14 CEST 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jun 16 21:53:36 2010 +0200| [a8c86004499bed7014dfbdbe188a113759f7e340] | committer: Jean-Baptiste Kempf 

Qt/EPG: use a qgraphicsitem_cast instead of dynamic_cast

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

 modules/gui/qt4/components/epg/EPGView.cpp |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/modules/gui/qt4/components/epg/EPGView.cpp b/modules/gui/qt4/components/epg/EPGView.cpp
index ea32110..5a8da87 100644
--- a/modules/gui/qt4/components/epg/EPGView.cpp
+++ b/modules/gui/qt4/components/epg/EPGView.cpp
@@ -60,11 +60,7 @@ void EPGView::setStartTime( const QDateTime& startTime )
 
     for ( int i = 0; i < itemList.count(); ++i )
     {
-#ifndef WIN32
-        EPGItem* item = dynamic_cast<EPGItem*>( itemList.at( i ) );
-#else
-        EPGItem *item = NULL;
-#endif
+        EPGItem* item = qgraphicsitem_cast<EPGItem*>( itemList.at( i ) );
         if ( !item ) continue;
         item->setStart( item->start().addSecs( diff ) );
     }
@@ -114,11 +110,7 @@ void EPGView::updateDuration()
 
     for ( int i = 0; i < list.count(); ++i )
     {
-#ifndef WIN32
-        EPGItem* item = dynamic_cast<EPGItem*>( list.at( i ) );
-#else
-        EPGItem *item = NULL;
-#endif
+        EPGItem* item = qgraphicsitem_cast<EPGItem*>( list.at( i ) );
         if ( !item ) continue;
         QDateTime itemEnd = item->start().addSecs( item->duration() );
 



More information about the vlc-commits mailing list