Commit 05f7d6b6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

config: remove useless config_GetPszChoices() parameter

parent 75781357
...@@ -243,7 +243,7 @@ VLC_API ssize_t config_GetIntChoices(const char *, int64_t **values, ...@@ -243,7 +243,7 @@ VLC_API ssize_t config_GetIntChoices(const char *, int64_t **values,
* descriptions and on both tables. * descriptions and on both tables.
* In case of error, both pointers are set to NULL. * In case of error, both pointers are set to NULL.
*/ */
VLC_API ssize_t config_GetPszChoices(vlc_object_t *, const char *, VLC_API ssize_t config_GetPszChoices(const char *,
char ***, char ***) VLC_USED; char ***, char ***) VLC_USED;
VLC_API int config_SaveConfigFile( vlc_object_t * ); VLC_API int config_SaveConfigFile( vlc_object_t * );
......
...@@ -194,8 +194,7 @@ libvlc_audio_output_device_list_get( libvlc_instance_t *p_instance, ...@@ -194,8 +194,7 @@ libvlc_audio_output_device_list_get( libvlc_instance_t *p_instance,
libvlc_audio_output_device_t *list = NULL, **pp = &list; libvlc_audio_output_device_t *list = NULL, **pp = &list;
char **values, **texts; char **values, **texts;
ssize_t count = config_GetPszChoices( VLC_OBJECT(p_instance->p_libvlc_int), ssize_t count = config_GetPszChoices( varname, &values, &texts );
varname, &values, &texts );
for( ssize_t i = 0; i < count; i++ ) for( ssize_t i = 0; i < count; i++ )
{ {
libvlc_audio_output_device_t *item = malloc( sizeof(*item) ); libvlc_audio_output_device_t *item = malloc( sizeof(*item) );
......
...@@ -416,8 +416,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p ...@@ -416,8 +416,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
assert(p_item); assert(p_item);
char **values, **texts; char **values, **texts;
ssize_t count = config_GetPszChoices(VLC_OBJECT(getIntf()), name, ssize_t count = config_GetPszChoices(name, &values, &texts);
&values, &texts);
if (count < 0) { if (count < 0) {
msg_Err(p_intf, "Cannot get choices for %s", name); msg_Err(p_intf, "Cannot get choices for %s", name);
return; return;
......
...@@ -1058,7 +1058,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \ ...@@ -1058,7 +1058,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
char *psz_value = config_GetPsz(self.p_item->psz_name); char *psz_value = config_GetPsz(self.p_item->psz_name);
char **values, **texts; char **values, **texts;
ssize_t count = config_GetPszChoices(VLC_OBJECT(getIntf()), self.p_item->psz_name, ssize_t count = config_GetPszChoices(self.p_item->psz_name,
&values, &texts); &values, &texts);
for (ssize_t i = 0; i < count && texts; i++) { for (ssize_t i = 0; i < count && texts; i++) {
if (texts[i] == NULL || values[i] == NULL) if (texts[i] == NULL || values[i] == NULL)
......
...@@ -411,8 +411,7 @@ void ExtVideo::initComboBoxItems( QObject *widget ) ...@@ -411,8 +411,7 @@ void ExtVideo::initComboBoxItems( QObject *widget )
{ {
char **values; char **values;
char **texts; char **texts;
ssize_t count = config_GetPszChoices( VLC_OBJECT( p_intf ), ssize_t count = config_GetPszChoices( qtu( option ), &values, &texts );
qtu( option ), &values, &texts );
for( ssize_t i = 0; i < count; i++ ) for( ssize_t i = 0; i < count; i++ )
{ {
combobox->addItem( qtr( texts[i] ), qfu(values[i]) ); combobox->addItem( qtr( texts[i] ), qfu(values[i]) );
......
...@@ -434,8 +434,7 @@ void StringListConfigControl::finish(module_config_t *p_module_config ) ...@@ -434,8 +434,7 @@ void StringListConfigControl::finish(module_config_t *p_module_config )
if(!p_module_config) return; if(!p_module_config) return;
char **values, **texts; char **values, **texts;
ssize_t count = config_GetPszChoices( p_this, p_item->psz_name, ssize_t count = config_GetPszChoices( p_item->psz_name, &values, &texts );
&values, &texts );
for( ssize_t i = 0; i < count && texts; i++ ) for( ssize_t i = 0; i < count && texts; i++ )
{ {
if( texts[i] == NULL || values[i] == NULL ) if( texts[i] == NULL || values[i] == NULL )
...@@ -476,8 +475,7 @@ void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf, ...@@ -476,8 +475,7 @@ void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
if( (p_config->i_type & 0xF0) == CONFIG_ITEM_STRING ) if( (p_config->i_type & 0xF0) == CONFIG_ITEM_STRING )
{ {
char **values, **texts; char **values, **texts;
ssize_t count = config_GetPszChoices(VLC_OBJECT(p_intf), ssize_t count = config_GetPszChoices(configname, &values, &texts);
configname, &values, &texts);
for( ssize_t i = 0; i < count; i++ ) for( ssize_t i = 0; i < count; i++ )
{ {
combo->addItem( qtr(texts[i]), QVariant(qfu(values[i])) ); combo->addItem( qtr(texts[i]), QVariant(qfu(values[i])) );
......
...@@ -284,8 +284,8 @@ static ssize_t config_ListModules (const char *cap, char ***restrict values, ...@@ -284,8 +284,8 @@ static ssize_t config_ListModules (const char *cap, char ***restrict values,
return n + 2; return n + 2;
} }
ssize_t config_GetPszChoices (vlc_object_t *obj, const char *name, ssize_t config_GetPszChoices(const char *name,
char ***restrict values, char ***restrict texts) char ***restrict values, char ***restrict texts)
{ {
*values = *texts = NULL; *values = *texts = NULL;
...@@ -312,7 +312,7 @@ ssize_t config_GetPszChoices (vlc_object_t *obj, const char *name, ...@@ -312,7 +312,7 @@ ssize_t config_GetPszChoices (vlc_object_t *obj, const char *name,
size_t count = cfg->list_count; size_t count = cfg->list_count;
if (count == 0) if (count == 0)
{ {
if (module_Map(obj, cfg->owner)) if (module_Map(NULL, cfg->owner))
{ {
errno = EIO; errno = EIO;
return -1; return -1;
......
...@@ -345,7 +345,7 @@ static int vlc_swidth(const char *str) ...@@ -345,7 +345,7 @@ static int vlc_swidth(const char *str)
} }
} }
static void print_item(const vlc_object_t *p_this, const module_t *m, const module_config_t *item, static void print_item(const module_t *m, const module_config_t *item,
const module_config_t **section, bool color, bool desc) const module_config_t **section, bool color, bool desc)
{ {
#ifndef _WIN32 #ifndef _WIN32
...@@ -384,7 +384,7 @@ static void print_item(const vlc_object_t *p_this, const module_t *m, const modu ...@@ -384,7 +384,7 @@ static void print_item(const vlc_object_t *p_this, const module_t *m, const modu
char **ppsz_values, **ppsz_texts; char **ppsz_values, **ppsz_texts;
ssize_t i_count = config_GetPszChoices(VLC_OBJECT(p_this), item->psz_name, &ppsz_values, &ppsz_texts); ssize_t i_count = config_GetPszChoices(item->psz_name, &ppsz_values, &ppsz_texts);
if (i_count > 0) if (i_count > 0)
{ {
...@@ -642,7 +642,7 @@ static void Usage (vlc_object_t *p_this, char const *psz_search) ...@@ -642,7 +642,7 @@ static void Usage (vlc_object_t *p_this, char const *psz_search)
b_has_advanced = true; b_has_advanced = true;
continue; continue;
} }
print_item(p_this, m, item, &section, color, desc); print_item(m, item, &section, color, desc);
} }
} }
......
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