From a0df876d586553b3d11b85a63405d309c3bee898 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 4 Sep 2020 18:43:28 +0200 Subject: [PATCH] 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. --- common/settings/settings_manager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index 6eaeb39ff6..1c203057e1 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -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 ); }