[vlc-commits] Qt4: use config_GetIntChoices() for integer config items

Rémi Denis-Courmont git at videolan.org
Wed Aug 15 09:51:04 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug 15 10:26:50 2012 +0300| [e960f0f8f8d6eefe9d3dadc86497fbba236571ca] | committer: Rémi Denis-Courmont

Qt4: use config_GetIntChoices() for integer config items

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

 modules/gui/qt4/components/preferences_widgets.cpp |   22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 0bce9e7..4a042b0 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -961,21 +961,19 @@ void IntegerListConfigControl::finish(module_config_t *p_module_config )
 
     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);
-    }
-
-    for( int i_index = 0; i_index < p_module_config->i_list; i_index++ )
+    int64_t *values;
+    char **texts;
+    ssize_t count = config_GetIntChoices( p_this, p_module_config->psz_name,
+                                          &values, &texts );
+    for( ssize_t i = 0; i < count; i++ )
     {
-        combo->addItem( qtr(p_module_config->ppsz_list_text[i_index] ),
-                        QVariant( p_module_config->pi_list[i_index] ) );
-        if( p_module_config->value.i == p_module_config->pi_list[i_index] )
+        combo->addItem( qtr(texts[i]), qlonglong(values[i]) );
+        if( p_module_config->value.i == values[i] )
             combo->setCurrentIndex( combo->count() - 1 );
+        free( texts[i] );
     }
+    free( texts );
+    free( values );
     if( p_item->psz_longtext )
     {
         QString tipText = qtr(p_item->psz_longtext );



More information about the vlc-commits mailing list