[vlc-devel] commit: Qt4: Document and assert when needed. (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri May 1 00:21:26 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri May  1 00:21:09 2009 +0200| [612de111b4b11ee0063b37c18ad511b36c9c7f72] | committer: Jean-Baptiste Kempf 

Qt4: Document and assert when needed.

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

 .../gui/qt4/components/sout/profile_selector.cpp   |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/sout/profile_selector.cpp b/modules/gui/qt4/components/sout/profile_selector.cpp
index 23365b8..f4d1dd2 100644
--- a/modules/gui/qt4/components/sout/profile_selector.cpp
+++ b/modules/gui/qt4/components/sout/profile_selector.cpp
@@ -32,6 +32,8 @@
 #include <QLabel>
 #include <QMessageBox>
 
+#include <assert.h>
+
 VLCProfileSelector::VLCProfileSelector( QWidget *_parent ): QWidget( _parent )
 {
     QHBoxLayout *layout = new QHBoxLayout( this );
@@ -111,17 +113,24 @@ void VLCProfileSelector::editProfile()
 
 void VLCProfileSelector::editProfile( const QString& qs, const QString& value )
 {
+    /* Create the Profile Editor */
     VLCProfileEditor *editor = new VLCProfileEditor( qs, value, this );
 
+    /* Show it */
     if( QDialog::Accepted == editor->exec() )
     {
+        /* New Profile */
         if( qs.isEmpty() )
             profileBox->addItem( editor->name, QVariant( editor->transcodeValue() ) );
+        /* Update old profile */
         else
         {
+            /* Look for the profile */
             int i_profile = profileBox->findText( qs );
+            assert( i_profile != -1 );
             profileBox->setItemText( i_profile, editor->name );
             profileBox->setItemData( i_profile, QVariant( editor->transcodeValue() ) );
+            /* Force mrl recreation */
             updateOptions( i_profile );
         }
     }




More information about the vlc-devel mailing list