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

Remove unused config_SaveConfigFile parameter

parent 9921f0b7
......@@ -198,8 +198,9 @@ VLC_EXPORT( void, config_PutFloat, (vlc_object_t *, const char *, float) );
VLC_EXPORT( char *, config_GetPsz, (vlc_object_t *, const char *) LIBVLC_USED LIBVLC_MALLOC );
VLC_EXPORT( void, config_PutPsz, (vlc_object_t *, const char *, const char *) );
VLC_EXPORT( int, config_SaveConfigFile, ( vlc_object_t *, const char * ) );
#define config_SaveConfigFile(a,b) config_SaveConfigFile(VLC_OBJECT(a),b)
VLC_EXPORT( int, config_SaveConfigFile, ( vlc_object_t * ) );
#define config_SaveConfigFile(a) config_SaveConfigFile(VLC_OBJECT(a))
VLC_EXPORT( void, config_ResetAll, ( vlc_object_t * ) );
#define config_ResetAll(a) config_ResetAll(VLC_OBJECT(a))
......
......@@ -51,8 +51,11 @@ void FirstRun::save()
#endif
config_PutInt( p_intf, "qt-privacy-ask", 0 );
/* FIXME Should not save here. This will not work as expected if another
* plugin overwrote items of its own. */
#warning FIXME
/* We have to save here because the user may not launch Prefs */
config_SaveConfigFile( p_intf, NULL );
config_SaveConfigFile( p_intf );
close();
}
......
......@@ -295,7 +295,7 @@ void PrefsDialog::save()
}
/* Save to file */
if( config_SaveConfigFile( p_intf, NULL ) != 0 )
if( config_SaveConfigFile( p_intf ) != 0 )
{
ErrorsDialog::getInstance (p_intf)->addError( qtr( "Cannot save Configuration" ),
qtr("Preferences file could not be saved") );
......@@ -322,7 +322,7 @@ void PrefsDialog::reset()
if( ret == QMessageBox::Ok )
{
config_ResetAll( p_intf );
config_SaveConfigFile( p_intf, NULL );
config_SaveConfigFile( p_intf );
getSettings()->clear();
accept();
......
......@@ -283,7 +283,7 @@ static void *Run( void * p_obj )
}
// save config file
config_SaveConfigFile( p_intf, NULL );
config_SaveConfigFile( p_intf );
end:
// Destroy "singleton" objects
......
......@@ -343,8 +343,6 @@ static int config_PrepareDir (vlc_object_t *obj)
/*****************************************************************************
* config_SaveConfigFile: Save a module's config options.
*****************************************************************************
* This will save the specified module's config options to the config file.
* If psz_module_name is NULL then we save all the modules config options.
* It's no use to save the config options that kept their default values, so
* we'll try to be a bit clever here.
*
......@@ -359,8 +357,7 @@ static int config_PrepareDir (vlc_object_t *obj)
* save.
* Really stupid no ?
*****************************************************************************/
static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
bool b_autosave )
static int SaveConfigFile( vlc_object_t *p_this, bool b_autosave )
{
module_t *p_parser;
char *permanent = NULL, *temporary = NULL;
......@@ -415,9 +412,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
for (int i = 0; (p_parser = list[i]) != NULL; i++)
{
if (!strncmp (line + 1, p_parser->psz_object_name,
strlen (p_parser->psz_object_name))
&& ((psz_module_name == NULL)
|| !strcmp (psz_module_name, p_parser->psz_object_name)))
strlen (p_parser->psz_object_name)))
{
backup = false; /* no, we will rewrite it! */
break;
......@@ -507,17 +502,9 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
{
module_config_t *p_item, *p_end;
if( psz_module_name && strcmp( psz_module_name,
p_parser->psz_object_name ) )
continue;
if( !p_parser->i_config_items )
continue;
if( psz_module_name )
msg_Dbg( p_this, "saving config for module \"%s\"",
p_parser->psz_object_name );
fprintf( file, "[%s]", p_parser->psz_object_name );
if( p_parser->psz_longname )
fprintf( file, " # %s\n\n", p_parser->psz_longname );
......@@ -685,7 +672,7 @@ int config_AutoSaveConfigFile( vlc_object_t *p_this )
if (save)
/* Note: this will get the read lock recursively. Ok. */
ret = SaveConfigFile (p_this, NULL, true);
ret = SaveConfigFile (p_this, true);
vlc_rwlock_unlock (&config_lock);
module_list_free (list);
......@@ -693,7 +680,7 @@ int config_AutoSaveConfigFile( vlc_object_t *p_this )
}
#undef config_SaveConfigFile
int config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
int config_SaveConfigFile( vlc_object_t *p_this )
{
return SaveConfigFile( p_this, psz_module_name, false );
return SaveConfigFile( p_this, false );
}
......@@ -467,7 +467,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
if( var_InheritBool( p_libvlc, "reset-config" ) )
{
config_ResetAll( p_libvlc );
config_SaveConfigFile( p_libvlc, NULL );
config_SaveConfigFile( p_libvlc );
}
}
......
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