Configuration file consolidation patch from Moses McKnight.
* Create GetNewConfig() and GetKicadConfigPath() to unify configuration file creation and location. * Move Windows configuration out of the registry into configuration files. * Move Linux configuration files from $HOME to $HOME/.config/kicad to eliminate configuration file pollution in the users $HOME folder. * Fix a bug in the configuration file where the Eeschema hot keys are saved.
This commit is contained in:
committed by
Wayne Stambaugh
parent
5c954998bb
commit
6da5e2cdd0
@@ -533,8 +533,9 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList,
|
||||
}
|
||||
else
|
||||
{
|
||||
wxConfig config( m_FrameName );
|
||||
config.Write( HOTKEYS_CONFIG_KEY, msg );
|
||||
wxConfigBase* config = GetNewConfig( m_FrameName );
|
||||
config->Write( HOTKEYS_CONFIG_KEY, msg );
|
||||
delete config;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -575,16 +576,17 @@ int EDA_BASE_FRAME::ReadHotkeyConfigFile( const wxString& aFilename,
|
||||
|
||||
void ReadHotkeyConfig( const wxString& Appname, struct EDA_HOTKEY_CONFIG* aDescList )
|
||||
{
|
||||
wxConfig config( Appname );
|
||||
wxConfigBase* config = GetNewConfig( Appname );
|
||||
|
||||
if( !config.HasEntry( HOTKEYS_CONFIG_KEY ) )
|
||||
if( !config->HasEntry( HOTKEYS_CONFIG_KEY ) )
|
||||
{
|
||||
// assume defaults are ok
|
||||
return;
|
||||
}
|
||||
|
||||
wxString data;
|
||||
config.Read( HOTKEYS_CONFIG_KEY, &data );
|
||||
config->Read( HOTKEYS_CONFIG_KEY, &data );
|
||||
delete config;
|
||||
|
||||
ParseHotkeyConfig( data, aDescList );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user