]> git.sesse.net Git - vlc/commitdiff
Disclaimer : this commit would need to be checked by someone
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 13 Aug 2005 15:03:21 +0000 (15:03 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 13 Aug 2005 15:03:21 +0000 (15:03 +0000)
Change locale (LC_NUMERIC) in appropriate places so we always use the
user's locale when reading/writting floats to config (otherwise it would
read floats using C locale (float separator is . in C) and write them
using the user's local (float separator can be , instead of .))

If these changes aren't ok, then i think that the only solution would be
to always setlocale(LC_NUMERIC, "C") when handling config str<->float
conversions.

modules/gui/wxwidgets/preferences_widgets.cpp
modules/gui/wxwidgets/wxwidgets.cpp
src/libvlc.c

index 79f819d6dc7df698ba86002210080b9cbf7e57e3..10f500610cba041ed7151209db235f62e678c865 100644 (file)
@@ -460,13 +460,13 @@ void  ModuleListCatConfigControl::OnUpdate( wxCommandEvent &event )
 {
     bool b_waschecked = false;
     wxString newtext =  text->GetValue();
-    
+
     for( unsigned int i = 0 ; i< pp_checkboxes.size() ; i++ )
     {
         b_waschecked = newtext.Find( wxU(pp_checkboxes[i]->psz_module)) != -1 ;
         /* For some reasons, ^^ doesn't compile :( */
         if( (pp_checkboxes[i]->checkbox->IsChecked() && ! b_waschecked )||
-                       (! pp_checkboxes[i]->checkbox->IsChecked() && b_waschecked) )
+            (! pp_checkboxes[i]->checkbox->IsChecked() && b_waschecked) )
         {
             if( b_waschecked )
             {
@@ -477,7 +477,7 @@ void  ModuleListCatConfigControl::OnUpdate( wxCommandEvent &event )
                 {
                     if( ! newtext.Replace(wxString(wxU(pp_checkboxes[i]->psz_module))
                                            + wxT(":"),wxT("")))
-                   { 
+            {
                         newtext.Replace(wxU(pp_checkboxes[i]->psz_module),wxU(""));
                     }
                 }
index b904eb0b822d9b1d1d10e9725916cc52aee4af51..f31972368e3bd13c575201750fbfb86a8158ff30 100644 (file)
@@ -332,8 +332,9 @@ bool Instance::OnInit()
     locale.Init( wxLANGUAGE_DEFAULT );
 
     /* FIXME: The stream output mrl parsing uses ',' already so we want to
-     * keep the default '.' for floating point numbers. */
-    setlocale( LC_NUMERIC, "C" );
+     * keep the default '.' for floating point numbers.
+     * XXX (dionoea 13/08/2005) : This breaks prefs handling for floats
+     * setlocale( LC_NUMERIC, "C" ); */
 
     /* Load saved window settings */
     p_intf->p_sys->p_window_settings = new WindowSettings( p_intf );
index 173910b8d6138350c4e2028145b2f0e782767f54..27ec60b0ba4a5b8c1e8165eda124115be410980d 100644 (file)
@@ -529,6 +529,9 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     /*
      * Override default configuration with config file settings
      */
+    /* (dionoea 13/08/2005) : we need to load locale here in order to have
+     * coherent float encoding with subsequent SaveConfigFile calls */
+    setlocale( LC_NUMERIC, "" );
     config_LoadConfigFile( p_vlc, NULL );
 
     /* Hack: insert the help module here */