[vlc-devel] commit: Qt: be sure that the conversion to Int from TYPE_ROLE worked ( Jean-Baptiste Kempf )

git version control git at videolan.org
Tue Sep 8 10:34:05 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Sep  8 10:33:44 2009 +0200| [51e801ba922a6329304bc706ed5ddbcca77ce58f] | committer: Jean-Baptiste Kempf 

Qt: be sure that the conversion to Int from TYPE_ROLE worked

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

 modules/gui/qt4/components/playlist/selector.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index 5ec816b..4c60a00 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -70,7 +70,10 @@ void PLSelector::setSource( QTreeWidgetItem *item )
     if( !item )
         return;
 
-    int i_type = item->data( 0, TYPE_ROLE ).toInt();
+    bool b_ok;
+    int i_type = item->data( 0, TYPE_ROLE ).toInt( &b_ok );
+    if( !b_ok )
+        return;
 
     assert( ( i_type == PL_TYPE || i_type == ML_TYPE || i_type == SD_TYPE ) );
     if( i_type == SD_TYPE )




More information about the vlc-devel mailing list