Qt: Fix several cases where shader selections don't get saved
Vicki Pfau vi@endrift.com
Sat, 14 Dec 2019 13:09:09 -0800
2 files changed,
4 insertions(+),
7 deletions(-)
M
CHANGES
→
CHANGES
@@ -98,6 +98,7 @@ - Core: Fix uninitialized memory issues with graphics caches
- 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)
M
src/platform/qt/ShaderSelector.cpp
→
src/platform/qt/ShaderSelector.cpp
@@ -33,6 +33,7 @@ ShaderSelector::ShaderSelector(Display* display, ConfigController* config, QWidget* parent)
: 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 @@
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 @@ }
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() {@@ -118,10 +118,6 @@
disconnect(this, &ShaderSelector::saved, 0, 0); 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) {