]> git.sesse.net Git - vlc/commitdiff
Qt: fix StringList in Simple preferences
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 3 Jan 2010 23:58:02 +0000 (00:58 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 3 Jan 2010 23:58:50 +0000 (00:58 +0100)
The list wasn't correctly updated when there was an action to update_list.
This fix the weird DirectSound bug.

modules/gui/qt4/components/preferences_widgets.cpp

index 24712fe46e83c78ece9379df6a8ad4192cfc25e5..e1ff9971fdcb31644a08b42eb061d64c6132285c 100644 (file)
@@ -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] ),