Commit 6e256bcc authored by Antoine Cellerier's avatar Antoine Cellerier

Disclaimer : this commit would need to be checked by someone

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.
parent e43b548b
......@@ -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(""));
}
}
......
......@@ -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 );
......
......@@ -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 */
......
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