SETTINGS_MANAGER::SaveColorSettings(): Ensure the destination folder exists.

For new users, this folder noes not exists, and saving colors does not work.
If this folder does not exist, it is not created.
This commit is contained in:
jean-pierre charras 2020-09-04 18:43:28 +02:00
parent 800d8acb00
commit a0df876d58
1 changed files with 4 additions and 0 deletions

View File

@ -326,6 +326,10 @@ void SETTINGS_MANAGER::SaveColorSettings( COLOR_SETTINGS* aSettings, const std::
( *aSettings )[ptr].update( backup );
aSettings->Load();
// Ensure the folder to store the config exists:
if( !wxDir::Exists( SETTINGS_MANAGER::GetColorSettingsPath() ) )
wxDir::Make( SETTINGS_MANAGER::GetColorSettingsPath() );
aSettings->SaveToFile( path, true );
}