Commit 3c0909d8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

config: remove unused config_GetPsz() parameter

parent 2c384e37
......@@ -203,8 +203,7 @@ VLC_API void config_PutFloat(vlc_object_t *, const char *name, float val);
* or if an error occurs, NULL is returned.
* \bug The empty string value cannot be distinguished from an error.
*/
VLC_API char * config_GetPsz(vlc_object_t *, const char *name)
VLC_USED VLC_MALLOC;
VLC_API char *config_GetPsz(const char *name) VLC_USED VLC_MALLOC;
/**
* Sets an string configuration item.
......@@ -326,7 +325,6 @@ VLC_API bool config_ExistIntf( vlc_object_t *, const char * ) VLC_USED;
#define config_PutInt(a,b,c) config_PutInt(VLC_OBJECT(a),b,c)
#define config_PutFloat(a,b,c) config_PutFloat(VLC_OBJECT(a),b,c)
#define config_GetPsz(a,b) config_GetPsz(VLC_OBJECT(a),b)
#define config_PutPsz(a,b,c) config_PutPsz(VLC_OBJECT(a),b,c)
#define config_AddIntf(a,b) config_AddIntf(VLC_OBJECT(a),b)
......
......@@ -686,7 +686,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
BOOL b_needsRestart = NO;
#define fixpref(pref) \
o_workString = [[NSMutableString alloc] initWithFormat:@"%s", config_GetPsz(getIntf(), pref)]; \
o_workString = [[NSMutableString alloc] initWithFormat:@"%s", config_GetPsz(pref)]; \
if ([o_workString length] > 0) \
{ \
returnedRange = [o_workString rangeOfString:@"macosx" options: NSCaseInsensitiveSearch]; \
......
......@@ -114,7 +114,7 @@
[self initStrings];
key = config_GetPsz(p_intf, "key-quit");
key = config_GetPsz("key-quit");
keyString = [NSString stringWithFormat:@"%s", key];
[_quit setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_quit setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
......@@ -122,85 +122,85 @@
// do not assign play/pause key
key = config_GetPsz(p_intf, "key-stop");
key = config_GetPsz("key-stop");
keyString = [NSString stringWithFormat:@"%s", key];
[_stop setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_stop setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-prev");
key = config_GetPsz("key-prev");
keyString = [NSString stringWithFormat:@"%s", key];
[_previous setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_previous setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-next");
key = config_GetPsz("key-next");
keyString = [NSString stringWithFormat:@"%s", key];
[_next setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_next setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-jump+short");
key = config_GetPsz("key-jump+short");
keyString = [NSString stringWithFormat:@"%s", key];
[_fwd setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_fwd setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-jump-short");
key = config_GetPsz("key-jump-short");
keyString = [NSString stringWithFormat:@"%s", key];
[_bwd setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_bwd setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-vol-up");
key = config_GetPsz("key-vol-up");
keyString = [NSString stringWithFormat:@"%s", key];
[_vol_up setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_vol_up setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-vol-down");
key = config_GetPsz("key-vol-down");
keyString = [NSString stringWithFormat:@"%s", key];
[_vol_down setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_vol_down setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-vol-mute");
key = config_GetPsz("key-vol-mute");
keyString = [NSString stringWithFormat:@"%s", key];
[_mute setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_mute setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-toggle-fullscreen");
key = config_GetPsz("key-toggle-fullscreen");
keyString = [NSString stringWithFormat:@"%s", key];
[_fullscreenItem setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_fullscreenItem setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-snapshot");
key = config_GetPsz("key-snapshot");
keyString = [NSString stringWithFormat:@"%s", key];
[_snapshot setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_snapshot setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-random");
key = config_GetPsz("key-random");
keyString = [NSString stringWithFormat:@"%s", key];
[_random setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_random setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-zoom-half");
key = config_GetPsz("key-zoom-half");
keyString = [NSString stringWithFormat:@"%s", key];
[_half_window setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_half_window setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-zoom-original");
key = config_GetPsz("key-zoom-original");
keyString = [NSString stringWithFormat:@"%s", key];
[_normal_window setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_normal_window setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
FREENULL(key);
key = config_GetPsz(p_intf, "key-zoom-double");
key = config_GetPsz("key-zoom-double");
keyString = [NSString stringWithFormat:@"%s", key];
[_double_window setKeyEquivalent: [stringUtility VLCKeyToString: keyString]];
[_double_window setKeyEquivalentModifierMask: [stringUtility VLCModifiersToCocoa:keyString]];
......@@ -254,7 +254,7 @@
[mitem setTag:x];
[mitem setTarget:self];
}
char *psz_config = config_GetPsz(p_intf, "video-filter");
char *psz_config = config_GetPsz("video-filter");
if (psz_config) {
if (!strstr(psz_config, "postproc"))
[[_postprocessingMenu itemAtIndex:0] setState:NSOnState];
......
......@@ -91,7 +91,7 @@ static const float f_min_window_height = 307.;
char *key;
NSString *o_key;
key = config_GetPsz(getIntf(), keyString);
key = config_GetPsz(keyString);
o_key = [NSString stringWithFormat:@"%s", key];
FREENULL(key);
......@@ -617,7 +617,7 @@ static const float f_min_window_height = 307.;
if (p_input) {
NSString *aString = @"";
if (!config_GetPsz(getIntf(), "video-title")) {
if (!config_GetPsz("video-title")) {
char *format = var_InheritString(getIntf(), "input-title-format");
if (format) {
char *formated = vlc_strfinput(p_input, format);
......@@ -626,7 +626,7 @@ static const float f_min_window_height = 307.;
free(formated);
}
} else
aString = toNSStr(config_GetPsz(getIntf(), "video-title"));
aString = toNSStr(config_GetPsz("video-title"));
char *uri = input_item_GetURI(input_GetItem(p_input));
......@@ -1177,8 +1177,8 @@ static const float f_min_window_height = 307.;
if (sender == _podcastSubscribeOkButton && [[_podcastSubscribeUrlField stringValue] length] > 0) {
NSMutableString *podcastConf = [[NSMutableString alloc] init];
if (config_GetPsz(getIntf(), "podcast-urls") != NULL)
[podcastConf appendFormat:@"%s|", config_GetPsz(getIntf(), "podcast-urls")];
if (config_GetPsz("podcast-urls") != NULL)
[podcastConf appendFormat:@"%s|", config_GetPsz("podcast-urls")];
[podcastConf appendString: [_podcastSubscribeUrlField stringValue]];
config_PutPsz(getIntf(), "podcast-urls", [podcastConf UTF8String]);
......@@ -1206,7 +1206,7 @@ static const float f_min_window_height = 307.;
playlist_t * p_playlist = pl_Get(getIntf());
char *psz_urls = var_InheritString(p_playlist, "podcast-urls");
NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[toNSStr(config_GetPsz(getIntf(), "podcast-urls")) componentsSeparatedByString:@"|"]];
NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[toNSStr(config_GetPsz("podcast-urls")) componentsSeparatedByString:@"|"]];
[urls removeObjectAtIndex: [_podcastUnsubscribePopUpButton indexOfSelectedItem]];
const char *psz_new_urls = [[urls componentsJoinedByString:@"|"] UTF8String];
var_SetString(pl_Get(getIntf()), "podcast-urls", psz_new_urls);
......
......@@ -491,7 +491,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
- (void)setupField:(NSTextField *)object forOption:(const char *)psz_option
{
char *psz_tmp = config_GetPsz(p_intf, psz_option);
char *psz_tmp = config_GetPsz(psz_option);
[object setStringValue: toNSStr(psz_tmp)];
[object setToolTip: _NS(config_GetLabel(p_intf, psz_option))];
free(psz_tmp);
......@@ -499,7 +499,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
- (BOOL)hasModule:(NSString *)moduleName inConfig:(NSString *)config
{
char *value = config_GetPsz(p_intf, [config UTF8String]);
char *value = config_GetPsz([config UTF8String]);
NSString *modules = toNSStr(value);
free(value);
......@@ -508,7 +508,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
- (void)changeModule:(NSString *)moduleName inConfig:(NSString *)config enable:(BOOL)enable
{
char *value = config_GetPsz(p_intf, [config UTF8String]);
char *value = config_GetPsz([config UTF8String]);
NSString *modules = toNSStr(value);
free(value);
......@@ -1217,7 +1217,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
- (IBAction)showFontPicker:(id)sender
{
char * font = config_GetPsz(p_intf, "freetype-font");
char * font = config_GetPsz("freetype-font");
NSString * fontName = font ? toNSStr(font) : nil;
free(font);
if (fontName) {
......
......@@ -974,7 +974,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
- (void)resetValues
{
NSString *o_textfieldString;
char *psz_value = config_GetPsz(getIntf(), self.p_item->psz_name);
char *psz_value = config_GetPsz(self.p_item->psz_name);
if (psz_value)
o_textfieldString = _NS(psz_value);
else
......@@ -1055,7 +1055,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
{
[o_popup removeAllItems];
char *psz_value = config_GetPsz(getIntf(), self.p_item->psz_name);
char *psz_value = config_GetPsz(self.p_item->psz_name);
char **values, **texts;
ssize_t count = config_GetPszChoices(VLC_OBJECT(getIntf()), self.p_item->psz_name,
......@@ -1170,7 +1170,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
-(void)resetValues
{
NSString *o_textfieldString;
char *psz_value = config_GetPsz(getIntf(), self.p_item->psz_name);
char *psz_value = config_GetPsz(self.p_item->psz_name);
if (psz_value)
o_textfieldString = [NSString stringWithFormat: @"%s", psz_value];
else
......
......@@ -1222,7 +1222,7 @@ static char *GetDiscDevice(intf_thread_t *intf, const char *name)
size_t n = devs[i].n;
if (!strncmp(name, devs[i].s, n)) {
if (name[n] == '@' || name[n] == '\0')
return config_GetPsz(intf, devs[i].v);
return config_GetPsz(devs[i].v);
/* Omit the beginning MRL-selector characters */
return strdup(name + n);
}
......
......@@ -1026,7 +1026,7 @@ QStringList EqualizerSliderData::getBandsFromAout() const
if ( ! config_FindConfig( qtu(p_data->name) ) )
return bands;
char *psz_bands = config_GetPsz( p_intf, qtu(p_data->name) );
char *psz_bands = config_GetPsz( qtu(p_data->name) );
if ( psz_bands )
{
bands = QString( psz_bands ).split( " ", QString::SkipEmptyParts );
......
......@@ -350,7 +350,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
};
QComboBox *discCombo = ui.deviceCombo; /* avoid namespacing in macro */
POPULATE_WITH_DEVS( ppsz_discdevices, discCombo );
char *psz_config = config_GetPsz( p_intf, "dvd" );
char *psz_config = config_GetPsz( "dvd" );
int temp = ui.deviceCombo->findData( psz_config, Qt::UserRole, Qt::MatchStartsWith );
free( psz_config );
if( temp != -1 )
......@@ -415,7 +415,7 @@ void DiscOpenPanel::onFocus()
SetThreadErrorMode(oldMode, NULL);
}
char *psz_config = config_GetPsz( p_intf, "dvd" );
char *psz_config = config_GetPsz( "dvd" );
int temp = ui.deviceCombo->findData( psz_config, Qt::UserRole, Qt::MatchStartsWith );
free( psz_config );
if( temp != -1 )
......
......@@ -595,7 +595,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONNECT( ui.volNormBox, toggled( bool ), ui.volNormSpin,
setEnabled( bool ) );
char* psz = config_GetPsz( p_intf, "audio-filter" );
char* psz = config_GetPsz( "audio-filter" );
qs_filter = qfu( psz ).split( ':', QString::SkipEmptyParts );
free( psz );
......@@ -618,9 +618,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
"for DVD, VCD, and CDDA are set.\n"
"You can define a unique one or configure them \n"
"individually in the advanced preferences." ) );
char *psz_dvddiscpath = config_GetPsz( p_intf, "dvd" );
char *psz_vcddiscpath = config_GetPsz( p_intf, "vcd" );
char *psz_cddadiscpath = config_GetPsz( p_intf, "cd-audio" );
char *psz_dvddiscpath = config_GetPsz( "dvd" );
char *psz_vcddiscpath = config_GetPsz( "vcd" );
char *psz_cddadiscpath = config_GetPsz( "cd-audio" );
if( psz_dvddiscpath && psz_vcddiscpath && psz_cddadiscpath )
if( !strcmp( psz_cddadiscpath, psz_dvddiscpath ) &&
!strcmp( psz_dvddiscpath, psz_vcddiscpath ) )
......@@ -746,7 +746,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#endif
/* interface */
char *psz_intf = config_GetPsz( p_intf, "intf" );
char *psz_intf = config_GetPsz( "intf" );
if( psz_intf )
{
if( strstr( psz_intf, "skin" ) )
......@@ -1113,7 +1113,7 @@ void SPrefsPanel::apply()
qobject_cast<QSlider *>(optionWidgets["defaultVolume"])->value();
bool b_reset_volume =
qobject_cast<QCheckBox *>(optionWidgets["resetVolumeCheckbox"])->isChecked();
char *psz_aout = config_GetPsz( p_intf, "aout" );
char *psz_aout = config_GetPsz( "aout" );
float f_gain = powf( i_volume / 100.f, 3 );
......
......@@ -42,7 +42,7 @@ PodcastConfigDialog::PodcastConfigDialog( intf_thread_t *_p_intf)
CONNECT( ui.podcastDelete, clicked(), this, remove() );
CONNECT( okButton, clicked(), this, close() );
char *psz_urls = config_GetPsz( p_intf, "podcast-urls" );
char *psz_urls = config_GetPsz( "podcast-urls" );
if( psz_urls )
{
char *psz_url = psz_urls;
......
......@@ -250,7 +250,7 @@ static void *Run( void * p_obj )
}
// Load a theme
skin_last = config_GetPsz( p_intf, "skins2-last" );
skin_last = config_GetPsz( "skins2-last" );
pLoader = new ThemeLoader( p_intf );
if( !skin_last || !pLoader->load( skin_last ) )
......
......@@ -98,7 +98,7 @@ int Theme::readConfig()
msg_Dbg( getIntf(), "reading theme configuration");
// Get config from vlcrc file
char *save = config_GetPsz( getIntf(), "skins2-config" );
char *save = config_GetPsz( "skins2-config" );
if( !save || !*save )
{
free( save );
......
......@@ -207,7 +207,7 @@ void ThemeRepository::updateRepository()
vlc_value_t val, text;
// retrieve the current skin
char* psz_current = config_GetPsz( getIntf(), "skins2-last" );
char* psz_current = config_GetPsz( "skins2-last" );
if( !psz_current )
return;
......
......@@ -42,13 +42,12 @@
*****************************************************************************/
static int vlclua_config_get( lua_State *L )
{
vlc_object_t * p_this = vlclua_get_this( L );
const char *psz_name = luaL_checkstring( L, 1 );
switch( config_GetType( psz_name ) )
{
case VLC_VAR_STRING:
{
char *psz = config_GetPsz( p_this, psz_name );
char *psz = config_GetPsz( psz_name );
lua_pushstring( L, psz );
free( psz );
break;
......
......@@ -482,14 +482,14 @@ void MediaServerList::parseNewServer( IXML_Document *doc, const std::string &loc
vlc_url_t url;
vlc_UrlParse( &url, psz_base_url );
char *psz_satip_channellist = config_GetPsz(m_sd, "satip-channelist");
char *psz_satip_channellist = config_GetPsz("satip-channelist");
if( !psz_satip_channellist ) {
break;
}
/* a user may have provided a custom playlist url */
if (strncmp(psz_satip_channellist, "CustomList", 10) == 0) {
char *psz_satip_playlist_url = config_GetPsz( m_sd, "satip-channellist-url" );
char *psz_satip_playlist_url = config_GetPsz( "satip-channellist-url" );
if ( psz_satip_playlist_url ) {
p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn, psz_friendly_name, psz_satip_playlist_url, iconUrl );
......
......@@ -111,8 +111,7 @@ float config_GetFloat(const char *psz_name)
return val;
}
#undef config_GetPsz
char * config_GetPsz( vlc_object_t *p_this, const char *psz_name )
char *config_GetPsz(const char *psz_name)
{
module_config_t *p_config;
......
......@@ -40,7 +40,7 @@ void config_AddIntf( vlc_object_t *p_this, const char *psz_intf )
char *psz_config, *psz_parser;
size_t i_len = strlen( psz_intf );
psz_config = psz_parser = config_GetPsz( libvlc, "control" );
psz_config = psz_parser = config_GetPsz( "control" );
while( psz_parser )
{
if( !strncmp( psz_intf, psz_parser, i_len ) )
......@@ -53,7 +53,7 @@ void config_AddIntf( vlc_object_t *p_this, const char *psz_intf )
}
free( psz_config );
psz_config = psz_parser = config_GetPsz( libvlc, "extraintf" );
psz_config = psz_parser = config_GetPsz( "extraintf" );
while( psz_parser )
{
if( !strncmp( psz_intf, psz_parser, i_len ) )
......@@ -92,7 +92,7 @@ void config_RemoveIntf( vlc_object_t *p_this, const char *psz_intf )
char *psz_config, *psz_parser;
size_t i_len = strlen( psz_intf );
psz_config = psz_parser = config_GetPsz( libvlc, "extraintf" );
psz_config = psz_parser = config_GetPsz( "extraintf" );
while( psz_parser )
{
if( !strncmp( psz_intf, psz_parser, i_len ) )
......@@ -113,7 +113,7 @@ void config_RemoveIntf( vlc_object_t *p_this, const char *psz_intf )
}
free( psz_config );
psz_config = psz_parser = config_GetPsz( libvlc, "control" );
psz_config = psz_parser = config_GetPsz( "control" );
while( psz_parser )
{
if( !strncmp( psz_intf, psz_parser, i_len ) )
......@@ -142,14 +142,12 @@ void config_RemoveIntf( vlc_object_t *p_this, const char *psz_intf )
*/
bool config_ExistIntf( vlc_object_t *p_this, const char *psz_intf )
{
vlc_object_t *libvlc = VLC_OBJECT(p_this->obj.libvlc);
assert( psz_intf );
char *psz_config, *psz_parser;
size_t i_len = strlen( psz_intf );
psz_config = psz_parser = config_GetPsz( libvlc, "extraintf" );
psz_config = psz_parser = config_GetPsz( "extraintf" );
while( psz_parser )
{
if( !strncmp( psz_parser, psz_intf, i_len ) )
......@@ -162,7 +160,7 @@ bool config_ExistIntf( vlc_object_t *p_this, const char *psz_intf )
}
free( psz_config );
psz_config = psz_parser = config_GetPsz( libvlc, "control" );
psz_config = psz_parser = config_GetPsz( "control" );
while( psz_parser )
{
if( !strncmp( psz_parser, psz_intf, i_len ) )
......
......@@ -1184,7 +1184,7 @@ int var_Inherit( vlc_object_t *p_this, const char *psz_name, int i_type,
switch( i_type & VLC_VAR_CLASS )
{
case VLC_VAR_STRING:
p_val->psz_string = config_GetPsz( p_this, psz_name );
p_val->psz_string = config_GetPsz( psz_name );
if( !p_val->psz_string ) p_val->psz_string = strdup("");
break;
case VLC_VAR_FLOAT:
......
......@@ -33,11 +33,11 @@ char *vlc_getProxyUrl(const char *psz_url)
{
VLC_UNUSED(psz_url);
char *proxy = config_GetPsz( (vlc_object_t *)(NULL), "http-proxy" );
char *proxy = config_GetPsz( "http-proxy" );
if (proxy == NULL)
return NULL;
char *proxy_pwd = config_GetPsz( (vlc_object_t *)(NULL), "http-proxy-pwd" );
char *proxy_pwd = config_GetPsz( "http-proxy-pwd" );
if (proxy_pwd == NULL)
return proxy;
......
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