From 00fbc8289d44dd702dd080534547510b993a5955 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 5 Oct 2021 11:58:31 +1000 Subject: [PATCH] Wx: Fix trace log settings getting very confused --- pcsx2/gui/AppConfig.cpp | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index e58bd3e733..a8c0560ea8 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -1175,10 +1175,12 @@ static void LoadUiSettings() ConLog_LoadSaveSettings(loader); SysTraceLog_LoadSaveSettings(loader); - wxSettingsInterface wxsi(&loader.GetConfig()); - SettingsLoadWrapper wrapper(wxsi); - g_Conf = std::make_unique(); - g_Conf->LoadSave(loader, wrapper); + { + wxSettingsInterface wxsi(&loader.GetConfig()); + SettingsLoadWrapper wrapper(wxsi); + g_Conf = std::make_unique(); + g_Conf->LoadSave(loader, wrapper); + } if (!wxFile::Exists(g_Conf->CurrentIso)) { @@ -1194,11 +1196,13 @@ static void LoadVmSettings() // are regulated by the PCSX2 UI. std::unique_ptr vmini(OpenFileConfig(GetVmSettingsFilename())); - wxSettingsInterface wxsi(vmini.get()); IniLoader vmloader(vmini.get()); - SettingsLoadWrapper vmwrapper(wxsi); - g_Conf->EmuOptions.LoadSave(vmwrapper); - g_Conf->EmuOptions.GS.LimitScalar = g_Conf->EmuOptions.Framerate.NominalScalar; + { + wxSettingsInterface wxsi(vmini.get()); + SettingsLoadWrapper vmwrapper(wxsi); + g_Conf->EmuOptions.LoadSave(vmwrapper); + g_Conf->EmuOptions.GS.LimitScalar = g_Conf->EmuOptions.Framerate.NominalScalar; + } if (g_Conf->EnablePresets) { @@ -1227,9 +1231,11 @@ static void SaveUiSettings() sApp.GetRecentIsoManager().Add(g_Conf->CurrentIso); AppIniSaver saver; - wxSettingsInterface wxsi(&saver.GetConfig()); - SettingsSaveWrapper wrapper(wxsi); - g_Conf->LoadSave(saver, wrapper); + { + wxSettingsInterface wxsi(&saver.GetConfig()); + SettingsSaveWrapper wrapper(wxsi); + g_Conf->LoadSave(saver, wrapper); + } ConLog_LoadSaveSettings(saver); SysTraceLog_LoadSaveSettings(saver); @@ -1239,10 +1245,12 @@ static void SaveUiSettings() static void SaveVmSettings() { std::unique_ptr vmini(OpenFileConfig(GetVmSettingsFilename())); - wxSettingsInterface wxsi(vmini.get()); IniSaver vmsaver(vmini.get()); - SettingsSaveWrapper vmwrapper(wxsi); - g_Conf->EmuOptions.LoadSave(vmwrapper); + { + wxSettingsInterface wxsi(vmini.get()); + SettingsSaveWrapper vmwrapper(wxsi); + g_Conf->EmuOptions.LoadSave(vmwrapper); + } sApp.DispatchVmSettingsEvent(vmsaver); }