From cd0f72d66a73358192c68ee85db7f06d7cdc2c82 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 30 Mar 2024 15:07:52 +0100 Subject: [PATCH] Remove pointless reloading of UserConfig It was added in 043cb2ea44, and the commit message was "reload config whenever returning to gui". I don't understand what this means; Run() is called exactly once after startup, so it would just reload the config again for no reason. We will add a real way of reloading the config whenever it has changed later in this branch. --- pkg/config/app_config.go | 11 ----------- pkg/gui/gui.go | 3 --- 2 files changed, 14 deletions(-) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index dd1635f6f..16f98cfb5 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -36,7 +36,6 @@ type AppConfigurer interface { GetUserConfig() *UserConfig GetUserConfigPaths() []string GetUserConfigDir() string - ReloadUserConfig() error GetTempDir() string GetAppState() *AppState @@ -252,16 +251,6 @@ func (c *AppConfig) GetUserConfigDir() string { return c.userConfigDir } -func (c *AppConfig) ReloadUserConfig() error { - userConfig, err := loadUserConfigWithDefaults(c.userConfigPaths) - if err != nil { - return err - } - - c.userConfig = userConfig - return nil -} - func (c *AppConfig) GetTempDir() string { return c.tempDir } diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index b65dd80e0..04e038d9c 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -658,9 +658,6 @@ func (gui *Gui) Run(startArgs appTypes.StartArgs) error { // breakpoints and stepping through code can easily take more than 30s. deadlock.Opts.Disable = !gui.Debug || os.Getenv(components.WAIT_FOR_DEBUGGER_ENV_VAR) != "" - if err := gui.Config.ReloadUserConfig(); err != nil { - return nil - } userConfig := gui.UserConfig gui.g.OnSearchEscape = func() error { gui.helpers.Search.Cancel(); return nil }