diff --git a/CHANGES b/CHANGES index 52da99df1..35613fca5 100644 --- a/CHANGES +++ b/CHANGES @@ -98,6 +98,7 @@ Other fixes: - Vita: Fix analog controls (fixes mgba.io/i/1554) - Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574) - Qt: Fix scrollbar arrows in memory view (fixes mgba.io/i/1558) + - Qt: Fix several cases where shader selections don't get saved Misc: - GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580) diff --git a/src/platform/qt/ShaderSelector.cpp b/src/platform/qt/ShaderSelector.cpp index 759cf6c7e..cf7f999a0 100644 --- a/src/platform/qt/ShaderSelector.cpp +++ b/src/platform/qt/ShaderSelector.cpp @@ -33,6 +33,7 @@ ShaderSelector::ShaderSelector(Display* display, ConfigController* config, QWidg : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint) , m_display(display) , m_config(config) + , m_shaderPath(config->getOption("shader")) { m_ui.setupUi(this); @@ -41,9 +42,6 @@ ShaderSelector::ShaderSelector(Display* display, ConfigController* config, QWidg connect(m_ui.load, &QAbstractButton::clicked, this, &ShaderSelector::selectShader); connect(m_ui.unload, &QAbstractButton::clicked, this, &ShaderSelector::clearShader); connect(m_ui.buttonBox, &QDialogButtonBox::clicked, this, &ShaderSelector::buttonPressed); - connect(this, &ShaderSelector::saved, [this]() { - m_config->setOption("shader", m_shaderPath); - }); } ShaderSelector::~ShaderSelector() { @@ -85,12 +83,14 @@ void ShaderSelector::loadShader(const QString& path) { m_display->setShaders(shader); shader->close(shader); m_shaderPath = path; + m_config->setOption("shader", m_shaderPath); } void ShaderSelector::clearShader() { m_display->clearShaders(); refreshShaders(); m_shaderPath = ""; + m_config->setOption("shader", m_shaderPath); } void ShaderSelector::refreshShaders() { @@ -119,10 +119,6 @@ void ShaderSelector::refreshShaders() { disconnect(this, &ShaderSelector::reset, 0, 0); disconnect(this, &ShaderSelector::resetToDefault, 0, 0); - connect(this, &ShaderSelector::saved, [this]() { - m_config->setOption("shader", m_shaderPath); - }); - #if !defined(_WIN32) || defined(USE_EPOXY) if (m_shaders->preprocessShader) { m_ui.passes->addTab(makePage(static_cast(m_shaders->preprocessShader), "default", 0), tr("Preprocessing"));