Commit ee7c9f46 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix StringList in Simple preferences

The list wasn't correctly updated when there was an action to update_list.
This fix the weird DirectSound bug.
parent 2b068d3a
......@@ -414,20 +414,6 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
combo->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
if(p_module_config && p_module_config->pf_update_list)
{
vlc_value_t val;
val.psz_string = strdup(p_module_config->value.psz);
p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
// assume in any case that dirty was set to true
// because lazy programmes will use the same callback for
// this, like the one behind the refresh push button?
p_module_config->b_dirty = false;
free( val.psz_string );
}
finish( p_module_config, bycat );
if( !l )
......@@ -500,6 +486,21 @@ void StringListConfigControl::finish(module_config_t *p_module_config, bool byca
if(!p_module_config) return;
if( p_module_config->pf_update_list )
{
vlc_value_t val;
val.psz_string = strdup(p_module_config->value.psz);
p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
// assume in any case that dirty was set to true
// because lazy programmes will use the same callback for
// this, like the one behind the refresh push button?
p_module_config->b_dirty = false;
free( val.psz_string );
}
for( int i_index = 0; i_index < p_module_config->i_list; i_index++ )
{
combo->addItem( qfu((p_module_config->ppsz_list_text &&
......@@ -914,19 +915,6 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
combo->setMinimumWidth( MINWIDTH_BOX );
module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
if(p_module_config && p_module_config->pf_update_list)
{
vlc_value_t val;
val.i_int = p_module_config->value.i;
p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
// assume in any case that dirty was set to true
// because lazy programmes will use the same callback for
// this, like the one behind the refresh push button?
p_module_config->b_dirty = false;
}
finish( p_module_config, bycat );
if( !l )
......@@ -978,6 +966,19 @@ void IntegerListConfigControl::finish(module_config_t *p_module_config, bool byc
if(!p_module_config) return;
if( p_module_config->pf_update_list )
{
vlc_value_t val;
val.i_int = p_module_config->value.i;
p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
// assume in any case that dirty was set to true
// because lazy programmes will use the same callback for
// this, like the one behind the refresh push button?
p_module_config->b_dirty = false;
}
for( int i_index = 0; i_index < p_module_config->i_list; i_index++ )
{
combo->addItem( qtr(p_module_config->ppsz_list_text[i_index] ),
......
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