]> git.sesse.net Git - vlc/commitdiff
Remove unused config_SaveConfigFile parameter
authorRémi Denis-Courmont <remi@remlab.net>
Fri, 29 Apr 2011 20:43:11 +0000 (23:43 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Fri, 29 Apr 2011 20:43:11 +0000 (23:43 +0300)
include/vlc_configuration.h
modules/gui/qt4/dialogs/firstrun.cpp
modules/gui/qt4/dialogs/preferences.cpp
modules/gui/skins2/src/skin_main.cpp
src/config/file.c
src/libvlc.c

index 31cd7615e0d2f03a580b65f64e0ed59ed81e5923..9ed8f136092de4ce718e81c9c48b4bacc7df9688 100644 (file)
@@ -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))
 
index 52b4fefce96bc1c67792081d6444522cfffbcb18..0b9667e6ec6c0c8e2ee8a3b373a9e6611b27b470 100644 (file)
@@ -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();
 }
 
index 2bfa9db793a3488580724f2b5ef0fa7256551e67..20a11ca156bed3aed2bd8fe4c45db1091544ba87 100644 (file)
@@ -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();
index 069935b73776bdf509bc212269c9b6bcdb40e15e..a03ab6b6932c840714e8e19353a1740e7c2369df 100644 (file)
@@ -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
index bdc29e228794e67a6c61b72a2d0cb4c0fda0b7e3..3d732ebb1b30c7e0be542f2d57f18f2f795b374c 100644 (file)
@@ -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 );
 }
index dc3f48f267b17d05285f0d4c004d7949034eab36..c495790a36a3134c3a36218acd943a8eb7a53b64 100644 (file)
@@ -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 );
         }
     }