Commit 36e7d201 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

lua: qt4: Fixing dropdown update function.

This closes #5000
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 7c9fdd3c59815196f9fc4cdfa7f7f2bc09cbfd67)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f7b9cb96
...@@ -609,20 +609,20 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget ) ...@@ -609,20 +609,20 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget )
case EXTENSION_WIDGET_DROPDOWN: case EXTENSION_WIDGET_DROPDOWN:
comboBox = static_cast< QComboBox* >( p_widget->p_sys_intf ); comboBox = static_cast< QComboBox* >( p_widget->p_sys_intf );
// method widget:clear()
if ( p_widget->p_values == NULL )
{
comboBox->clear(); comboBox->clear();
return comboBox;
}
// method widget:addvalue()
for( p_value = p_widget->p_values; for( p_value = p_widget->p_values;
p_value != NULL; p_value != NULL;
p_value = p_value->p_next ) p_value = p_value->p_next )
{ {
if ( comboBox->findText( qfu( p_value->psz_text ) ) < 0 )
comboBox->addItem( qfu( p_value->psz_text ), p_value->i_id ); 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 );
}
return comboBox; return comboBox;
case EXTENSION_WIDGET_LIST: case EXTENSION_WIDGET_LIST:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment