]> git.sesse.net Git - vlc/commitdiff
Qt/EPG: use a qgraphicsitem_cast instead of dynamic_cast
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 16 Jun 2010 19:53:36 +0000 (21:53 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 16 Jun 2010 19:53:36 +0000 (21:53 +0200)
modules/gui/qt4/components/epg/EPGView.cpp

index ea32110601ca581bccc8a8ac0d66b84aa9873bd9..5a8da879a47e7b31a01590982185cef979852d0e 100644 (file)
@@ -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() );