Commit 52341c8b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

config: remove unused config_PutPsz() parameter

parent d996d4fe
......@@ -221,7 +221,7 @@ VLC_API char *config_GetPsz(const char *name) VLC_USED VLC_MALLOC;
* \param val New value (will be copied)
* \bug This function allocates memory but errors cannot be detected.
*/
VLC_API void config_PutPsz(vlc_object_t *, const char *name, const char *val);
VLC_API void config_PutPsz(const char *name, const char *val);
/**
* Enumerates integer configuration choices.
......@@ -323,8 +323,6 @@ VLC_API void config_AddIntf( vlc_object_t *, const char * );
VLC_API void config_RemoveIntf( vlc_object_t *, const char * );
VLC_API bool config_ExistIntf( vlc_object_t *, const char * ) VLC_USED;
#define config_PutPsz(a,b,c) config_PutPsz(VLC_OBJECT(a),b,c)
#define config_AddIntf(a,b) config_AddIntf(VLC_OBJECT(a),b)
#define config_RemoveIntf(a,b) config_RemoveIntf(VLC_OBJECT(a),b)
#define config_ExistIntf(a,b) config_ExistIntf(VLC_OBJECT(a),b)
......
......@@ -1585,7 +1585,7 @@ static void Close(vlc_object_t *obj)
CFRelease(p_sys->device_list);
char *psz_device = aout_DeviceGet(p_aout);
config_PutPsz(p_aout, "auhal-audio-device", psz_device);
config_PutPsz("auhal-audio-device", psz_device);
free(psz_device);
vlc_mutex_destroy(&p_sys->selected_device_lock);
......
......@@ -1457,7 +1457,7 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
if( p_item )
{
config_PutPsz( p_intf, psz_bookmark_name, psz_uri);
config_PutPsz( psz_bookmark_name, psz_uri);
msg_Info( p_intf, "setting playlist bookmark %i to %s", i_num, psz_uri);
}
......
......@@ -699,7 +699,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
fullRange = NSMakeRange(0, [o_workString length]); \
[o_workString replaceOccurrencesOfString:@"macosx:" withString:@"" options: NSCaseInsensitiveSearch range: fullRange]; \
\
config_PutPsz(getIntf(), pref, [o_workString UTF8String]); \
config_PutPsz(pref, [o_workString UTF8String]); \
b_needsRestart = YES; \
} \
}
......
......@@ -96,8 +96,8 @@ static const int kCurrentPreferencesVersion = 4;
var_SetString(p_playlist, "audio-filter", "");
var_SetString(p_playlist, "video-filter", "");
config_PutPsz(getIntf(), "audio-filter", "");
config_PutPsz(getIntf(), "video-filter", "");
config_PutPsz("audio-filter", "");
config_PutPsz("video-filter", "");
config_SaveConfigFile(getIntf());
// This migration only has effect rarely, therefore only restart then
......
......@@ -1181,7 +1181,7 @@ static const float f_min_window_height = 307.;
[podcastConf appendFormat:@"%s|", config_GetPsz("podcast-urls")];
[podcastConf appendString: [_podcastSubscribeUrlField stringValue]];
config_PutPsz(getIntf(), "podcast-urls", [podcastConf UTF8String]);
config_PutPsz("podcast-urls", [podcastConf UTF8String]);
var_SetString(pl_Get(getIntf()), "podcast-urls", [podcastConf UTF8String]);
}
}
......@@ -1210,7 +1210,7 @@ static const float f_min_window_height = 307.;
[urls removeObjectAtIndex: [_podcastUnsubscribePopUpButton indexOfSelectedItem]];
const char *psz_new_urls = [[urls componentsJoinedByString:@"|"] UTF8String];
var_SetString(pl_Get(getIntf()), "podcast-urls", psz_new_urls);
config_PutPsz(getIntf(), "podcast-urls", psz_new_urls);
config_PutPsz("podcast-urls", psz_new_urls);
free(psz_urls);
......
......@@ -524,7 +524,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
// trim empty entries
[components removeObject:@""];
config_PutPsz(p_intf, [config UTF8String], [[components componentsJoinedByString:@":"] UTF8String]);
config_PutPsz([config UTF8String], [[components componentsJoinedByString:@":"] UTF8String]);
}
- (void)resetControls
......@@ -869,7 +869,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
NSString *p_stringobject = (NSString *)[[object selectedItem] representedObject];
if (p_stringobject) {
assert([p_stringobject isKindOfClass:[NSString class]]);
config_PutPsz(p_intf, name, [p_stringobject UTF8String]);
config_PutPsz(name, [p_stringobject UTF8String]);
}
}
......@@ -923,7 +923,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
[self changeModule:@"growl" inConfig:@"control" enable:[_intf_enableNotificationsCheckbox state] == NSOnState];
[self changeModule:@"http" inConfig:@"extraintf" enable:[_intf_enableluahttpCheckbox state] == NSOnState];
config_PutPsz(p_intf, "http-password", [[_intf_luahttppwdTextField stringValue] UTF8String]);
config_PutPsz("http-password", [[_intf_luahttppwdTextField stringValue] UTF8String]);
SaveIntList(_intf_pauseitunesPopup, "macosx-control-itunes");
SaveIntList(_intf_continueplaybackPopup, "macosx-continue-playback");
......@@ -948,7 +948,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
SaveIntList(_audio_dolbyPopup, "force-dolby-surround");
config_PutPsz(p_intf, "audio-language", [[_audio_langTextField stringValue] UTF8String]);
config_PutPsz("audio-language", [[_audio_langTextField stringValue] UTF8String]);
SaveModuleList(_audio_visualPopup, "audio-visual");
......@@ -960,8 +960,8 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
else
config_RemoveIntf(p_intf, "audioscrobbler");
config_PutPsz(p_intf, "lastfm-username", [[_audio_lastuserTextField stringValue] UTF8String]);
config_PutPsz(p_intf, "lastfm-password", [[_audio_lastpwdSecureTextField stringValue] UTF8String]);
config_PutPsz("lastfm-username", [[_audio_lastuserTextField stringValue] UTF8String]);
config_PutPsz("lastfm-password", [[_audio_lastpwdSecureTextField stringValue] UTF8String]);
}
else
[_audio_lastCheckbox setEnabled: NO];
......@@ -997,7 +997,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
* input & codecs settings *
***************************/
if (_inputSettingChanged) {
config_PutPsz(p_intf, "input-record-path", [[_input_recordTextField stringValue] UTF8String]);
config_PutPsz("input-record-path", [[_input_recordTextField stringValue] UTF8String]);
config_PutInt("postproc-q", [_input_postprocTextField intValue]);
config_PutInt("skip-frames", [_input_skipFramesCheckbox state]);
......@@ -1028,11 +1028,11 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
if ([_osd_encodingPopup indexOfSelectedItem] >= 0)
SaveStringList(_osd_encodingPopup, "subsdec-encoding");
else
config_PutPsz(p_intf, "subsdec-encoding", "");
config_PutPsz("subsdec-encoding", "");
config_PutPsz(p_intf, "sub-language", [[_osd_langTextField stringValue] UTF8String]);
config_PutPsz("sub-language", [[_osd_langTextField stringValue] UTF8String]);
config_PutPsz(p_intf, "freetype-font", [[_osd_fontTextField stringValue] UTF8String]);
config_PutPsz("freetype-font", [[_osd_fontTextField stringValue] UTF8String]);
SaveIntList(_osd_font_colorPopup, "freetype-color");
SaveIntList(_osd_font_sizePopup, "freetype-rel-fontsize");
config_PutInt("freetype-opacity", [_osd_opacityTextField intValue] * 255.0 / 100.0 + 0.5);
......@@ -1048,7 +1048,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
if (_hotkeyChanged) {
NSUInteger hotKeyCount = [_hotkeySettings count];
for (NSUInteger i = 0; i < hotKeyCount; i++)
config_PutPsz(p_intf, [[_hotkeyNames objectAtIndex:i] UTF8String], [[_hotkeySettings objectAtIndex:i]UTF8String]);
config_PutPsz([[_hotkeyNames objectAtIndex:i] UTF8String], [[_hotkeySettings objectAtIndex:i]UTF8String]);
_hotkeyChanged = NO;
}
......
......@@ -866,7 +866,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
case CONFIG_ITEM_MODULE_LIST:
case CONFIG_ITEM_MODULE_LIST_CAT: {
char *psz_val = [self stringValue];
config_PutPsz(getIntf(), psz_name, psz_val);
config_PutPsz(psz_name, psz_val);
free(psz_val);
break;
}
......
......@@ -204,7 +204,7 @@ void InterfacePreviewWidget::setPreview( enum_style e_style )
void
VStringConfigControl::doApply()
{
config_PutPsz( p_this, getName(), qtu( getValue() ) );
config_PutPsz( getName(), qtu( getValue() ) );
}
/*********** String **************/
......@@ -1354,12 +1354,10 @@ void KeySelectorControl::doApply()
{
it = table->topLevelItem(i);
if( it->data( HOTKEY_COL, Qt::UserRole ).toInt() >= 0 )
config_PutPsz( p_this,
qtu( it->data( ACTION_COL, Qt::UserRole ).toString() ),
config_PutPsz( qtu( it->data( ACTION_COL, Qt::UserRole ).toString() ),
qtu( it->data( HOTKEY_COL, Qt::UserRole ).toString() ) );
config_PutPsz( p_this,
qtu( "global-" + it->data( ACTION_COL, Qt::UserRole ).toString() ),
config_PutPsz( qtu( "global-" + it->data( ACTION_COL, Qt::UserRole ).toString() ),
qtu( it->data( GLOBAL_HOTKEY_COL, Qt::UserRole ).toString() ) );
}
}
......
......@@ -1053,9 +1053,9 @@ void SPrefsPanel::apply()
qobject_cast<QComboBox *>(optionWidgets["inputLE"])->currentText().toUtf8();
if( devicepath.size() > 0 )
{
config_PutPsz( p_intf, "dvd", devicepath );
config_PutPsz( p_intf, "vcd", devicepath );
config_PutPsz( p_intf, "cd-audio", devicepath );
config_PutPsz( "dvd", devicepath );
config_PutPsz( "vcd", devicepath );
config_PutPsz( "cd-audio", devicepath );
}
#define CaC( name, factor ) config_PutInt( name, i_comboValue * factor )
......@@ -1077,10 +1077,10 @@ void SPrefsPanel::apply()
case SPrefsInterface:
{
if( qobject_cast<QRadioButton *>(optionWidgets["skinRB"])->isChecked() )
config_PutPsz( p_intf, "intf", "skins2,any" );
config_PutPsz( "intf", "skins2,any" );
else
//if( qobject_cast<QRadioButton *>(optionWidgets[qtRB])->isChecked() )
config_PutPsz( p_intf, "intf", "" );
config_PutPsz( "intf", "" );
if( qobject_cast<QComboBox *>(optionWidgets["styleCB"]) )
getSettings()->setValue( "MainWindow/QtStyle",
qobject_cast<QComboBox *>(optionWidgets["styleCB"])->currentText() );
......@@ -1106,7 +1106,7 @@ void SPrefsPanel::apply()
if( !b_checked && qs_filter.contains( "normvol" ) )
qs_filter.removeAll( "normvol" );
config_PutPsz( p_intf, "audio-filter", qtu( qs_filter.join( ":" ) ) );
config_PutPsz( "audio-filter", qtu( qs_filter.join( ":" ) ) );
/* Default volume */
int i_volume =
......
......@@ -206,7 +206,7 @@ void ExtendedDialog::saveConfig()
switch( static_cast<QMetaType::Type>(value.type()) )
{
case QMetaType::QString:
config_PutPsz( p_intf, qtu(i.key()), qtu(value.toString()) );
config_PutPsz( qtu(i.key()), qtu(value.toString()) );
break;
case QMetaType::Int:
case QMetaType::Bool:
......
......@@ -70,7 +70,7 @@ void PodcastConfigDialog::accept()
urls += ui.podcastList->item(i)->text();
if( i != ui.podcastList->count()-1 ) urls += "|";
}
config_PutPsz( p_intf, "podcast-urls", qtu( urls ) );
config_PutPsz( "podcast-urls", qtu( urls ) );
if( playlist_IsServicesDiscoveryLoaded( THEPL, "podcast" ) )
{
......
......@@ -204,7 +204,7 @@ void Theme::saveConfig()
}
// Save config to file
config_PutPsz( getIntf(), "skins2-config", outStream.str().c_str() );
config_PutPsz( "skins2-config", outStream.str().c_str() );
}
......
......@@ -120,7 +120,7 @@ bool ThemeLoader::load( const std::string &fileName )
getIntf()->p_sys->p_theme->loadConfig();
// Retain new loaded skins in config
config_PutPsz( getIntf(), "skins2-last", fileName.c_str() );
config_PutPsz( "skins2-last", fileName.c_str() );
return true;
}
......
......@@ -102,7 +102,7 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
current = itdefault->second;
// save this valid skins for reuse
config_PutPsz( getIntf(), "skins2-last", current.c_str() );
config_PutPsz( "skins2-last", current.c_str() );
// Update repository
updateRepository();
......
......@@ -105,7 +105,7 @@ void EqualizerBands::onUpdate( Subject<VarPercent> &rBand, void *arg )
std::string bands = ss.str();
config_PutPsz( getIntf(), "equalizer-bands", bands.c_str() );
config_PutPsz( "equalizer-bands", bands.c_str() );
if( pAout )
{
// Update the audio output
......
......@@ -74,12 +74,11 @@ static int vlclua_config_get( lua_State *L )
static int vlclua_config_set( 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:
config_PutPsz( p_this, psz_name, luaL_checkstring( L, 2 ) );
config_PutPsz( psz_name, luaL_checkstring( L, 2 ) );
break;
case VLC_VAR_INTEGER:
......
......@@ -445,7 +445,7 @@ static void SaveUrls( services_discovery_t *p_sd )
if( i < p_sys->i_urls - 1 ) strcat( psz_urls, "|" );
}
config_PutPsz( p_sd, "podcast-urls", psz_urls );
config_PutPsz( "podcast-urls", psz_urls );
free( psz_urls );
}
......@@ -33,8 +33,6 @@
/* Adds an extra interface to the configuration */
void config_AddIntf( 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;
......@@ -71,12 +69,12 @@ void config_AddIntf( vlc_object_t *p_this, const char *psz_intf )
char *psz_newconfig;
if( asprintf( &psz_newconfig, "%s:%s", psz_config, psz_intf ) != -1 )
{
config_PutPsz( libvlc, "extraintf", psz_newconfig );
config_PutPsz( "extraintf", psz_newconfig );
free( psz_newconfig );
}
}
else
config_PutPsz( libvlc, "extraintf", psz_intf );
config_PutPsz( "extraintf", psz_intf );
free( psz_config );
}
......@@ -85,8 +83,6 @@ void config_AddIntf( vlc_object_t *p_this, const char *psz_intf )
/* Removes an extra interface from the configuration */
void config_RemoveIntf( 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;
......@@ -103,7 +99,7 @@ void config_RemoveIntf( vlc_object_t *p_this, const char *psz_intf )
*psz_parser = '\0';
if( asprintf( &psz_newconfig, "%s%s", psz_config, psz_end ) != -1 )
{
config_PutPsz( libvlc, "extraintf", psz_newconfig );
config_PutPsz( "extraintf", psz_newconfig );
free( psz_newconfig );
}
break;
......@@ -124,7 +120,7 @@ void config_RemoveIntf( vlc_object_t *p_this, const char *psz_intf )
*psz_parser = '\0';
if( asprintf( &psz_newconfig, "%s%s", psz_config, psz_end ) != -1 )
{
config_PutPsz( libvlc, "control", psz_newconfig );
config_PutPsz( "control", psz_newconfig );
free( psz_newconfig );
}
break;
......
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