Create color settings path if missing
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5274
This commit is contained in:
parent
8c93fc76ae
commit
c085375531
|
@ -573,6 +573,16 @@ wxString SETTINGS_MANAGER::GetColorSettingsPath()
|
||||||
path.AssignDir( GetUserSettingsPath() );
|
path.AssignDir( GetUserSettingsPath() );
|
||||||
path.AppendDir( "colors" );
|
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();
|
return path.GetPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,7 @@ public:
|
||||||
static bool IsSettingsPathValid( const wxString& aPath );
|
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)
|
* (normally ./colors/ under the user settings path)
|
||||||
*/
|
*/
|
||||||
static wxString GetColorSettingsPath();
|
static wxString GetColorSettingsPath();
|
||||||
|
|
Loading…
Reference in New Issue