[vlc-commits] lua: qt4: Fixing dropdown update function.
Hugo Beauzée-Luyssen
git at videolan.org
Thu Jul 7 12:59:29 CEST 2011
vlc/vlc-1.1 | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Jul 7 12:26:25 2011 +0200| [36e7d201945a62781110b962264498cfe2a54dde] | committer: Jean-Baptiste Kempf
lua: qt4: Fixing dropdown update function.
This closes #5000
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 7c9fdd3c59815196f9fc4cdfa7f7f2bc09cbfd67)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=36e7d201945a62781110b962264498cfe2a54dde
---
modules/gui/qt4/dialogs/extensions.cpp | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/modules/gui/qt4/dialogs/extensions.cpp b/modules/gui/qt4/dialogs/extensions.cpp
index 46633cc..0af5027 100644
--- a/modules/gui/qt4/dialogs/extensions.cpp
+++ b/modules/gui/qt4/dialogs/extensions.cpp
@@ -609,19 +609,19 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget )
case EXTENSION_WIDGET_DROPDOWN:
comboBox = static_cast< QComboBox* >( p_widget->p_sys_intf );
- comboBox->clear();
+ // method widget:clear()
+ if ( p_widget->p_values == NULL )
+ {
+ comboBox->clear();
+ return comboBox;
+ }
+ // method widget:addvalue()
for( p_value = p_widget->p_values;
p_value != NULL;
p_value = p_value->p_next )
{
- comboBox->addItem( qfu( p_value->psz_text ), p_value->i_id );
- }
- /* Set current item */
- if( p_widget->psz_text )
- {
- int idx = comboBox->findText( qfu( p_widget->psz_text ) );
- if( idx >= 0 )
- comboBox->setCurrentIndex( idx );
+ if ( comboBox->findText( qfu( p_value->psz_text ) ) < 0 )
+ comboBox->addItem( qfu( p_value->psz_text ), p_value->i_id );
}
return comboBox;
More information about the vlc-commits
mailing list