diff options
| author | JosJuice <josjuice@gmail.com> | 2026-03-04 21:53:18 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2026-03-04 22:26:25 +0100 |
| commit | d25ef67d6fc62eb96e0df8241d35a35e8ef38902 (patch) | |
| tree | 9f5c51dc553db43b1b88245c5f503c1ed58350b0 | |
| parent | 239c4e444c82c811eb321481aa26fe3a94d3b3c5 (diff) | |
DolphinQt: Save when closing settings window
If Dolphin crashes, changes that have been made to settings are often
lost. This has been a minor annoyance for me when developing, but it has
become a much bigger issue recently due to the problem where Dolphin
freezes on shutdown for ROG Ally users.
Instead of saving the config when certain arbitrary settings are
changed, let's save the config when the user closes the settings window.
| -rw-r--r-- | Source/Core/DolphinQt/Config/SettingsWindow.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Config/SettingsWindow.h | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Settings/GeneralPane.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Settings/WiiPane.cpp | 1 |
4 files changed, 7 insertions, 6 deletions
diff --git a/Source/Core/DolphinQt/Config/SettingsWindow.cpp b/Source/Core/DolphinQt/Config/SettingsWindow.cpp index e80b1fa7ff..283cd3786e 100644 --- a/Source/Core/DolphinQt/Config/SettingsWindow.cpp +++ b/Source/Core/DolphinQt/Config/SettingsWindow.cpp @@ -210,3 +210,8 @@ void SettingsWindow::SelectPane(SettingsWindowPaneIndex index) { ActivatePane(std::to_underlying(index)); } + +void SettingsWindow::closeEvent(QCloseEvent*) +{ + Config::Save(); +} diff --git a/Source/Core/DolphinQt/Config/SettingsWindow.h b/Source/Core/DolphinQt/Config/SettingsWindow.h index 3874c75ae0..c27d6e919d 100644 --- a/Source/Core/DolphinQt/Config/SettingsWindow.h +++ b/Source/Core/DolphinQt/Config/SettingsWindow.h @@ -60,4 +60,6 @@ public: explicit SettingsWindow(MainWindow* parent); void SelectPane(SettingsWindowPaneIndex); + + void closeEvent(QCloseEvent* event) override; }; diff --git a/Source/Core/DolphinQt/Settings/GeneralPane.cpp b/Source/Core/DolphinQt/Settings/GeneralPane.cpp index 802292f688..7561aaa939 100644 --- a/Source/Core/DolphinQt/Settings/GeneralPane.cpp +++ b/Source/Core/DolphinQt/Settings/GeneralPane.cpp @@ -16,7 +16,6 @@ #include "Core/AchievementManager.h" #include "Core/Config/MainSettings.h" #include "Core/Config/UISettings.h" -#include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/DolphinAnalytics.h" #include "Core/System.h" @@ -117,7 +116,6 @@ void GeneralPane::ConnectLayout() connect(m_combobox_speedlimit, &QComboBox::currentIndexChanged, [this] { Config::SetBaseOrCurrent(Config::MAIN_EMULATION_SPEED, m_combobox_speedlimit->currentIndex() * 0.1f); - Config::Save(); }); connect(m_combobox_fallback_region, &QComboBox::currentIndexChanged, this, @@ -339,7 +337,6 @@ void GeneralPane::OnSaveConfig() { Config::ConfigChangeCallbackGuard config_guard; - auto& settings = SConfig::GetInstance(); if (AutoUpdateChecker::SystemSupportsAutoUpdates()) { Settings::Instance().SetAutoUpdateTrack( @@ -356,8 +353,6 @@ void GeneralPane::OnSaveConfig() #endif Settings::Instance().SetFallbackRegion( UpdateFallbackRegionFromIndex(m_combobox_fallback_region->currentIndex())); - - settings.SaveSettings(); } #if defined(USE_ANALYTICS) && USE_ANALYTICS diff --git a/Source/Core/DolphinQt/Settings/WiiPane.cpp b/Source/Core/DolphinQt/Settings/WiiPane.cpp index 19d54ca50c..bab5b9b540 100644 --- a/Source/Core/DolphinQt/Settings/WiiPane.cpp +++ b/Source/Core/DolphinQt/Settings/WiiPane.cpp @@ -369,7 +369,6 @@ void WiiPane::OnUSBWhitelistAddButton() } whitelist.emplace(*usb_device); Config::SetUSBDeviceWhitelist(whitelist); - Config::Save(); PopulateUSBPassthroughListWidget(); } |
