Create color settings path if missing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5274
This commit is contained in:
Jon Evans 2020-10-25 16:56:22 -04:00
parent 8c93fc76ae
commit c085375531
2 changed files with 11 additions and 1 deletions

View File

@ -573,6 +573,16 @@ wxString SETTINGS_MANAGER::GetColorSettingsPath()
path.AssignDir( GetUserSettingsPath() );
path.AppendDir( "colors" );
if( !path.DirExists() )
{
if( !wxMkdir( path.GetPath() ) )
{
wxLogTrace( traceSettings,
"GetColorSettingsPath(): Path %s missing and could not be created!",
path.GetPath() );
}
}
return path.GetPath();
}

View File

@ -297,7 +297,7 @@ public:
static bool IsSettingsPathValid( const wxString& aPath );
/**
* Returns the path where color scheme files are stored
* Returns the path where color scheme files are stored; creating it if missing
* (normally ./colors/ under the user settings path)
*/
static wxString GetColorSettingsPath();