From f1d5564bf4106a3a5c7b570492e186d794de789f Mon Sep 17 00:00:00 2001 From: Louis BOSSY Date: Thu, 11 Jun 2026 11:50:36 +0200 Subject: [PATCH 1/2] Prevent Sf2Intrument from trying to load non-existing file on deserialization --- plugins/Sf2Player/Sf2Player.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index 57311c2f720..4ea1bb85e74 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -265,10 +265,14 @@ void Sf2Instrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) void Sf2Instrument::loadSettings( const QDomElement & _this ) { - openFile( _this.attribute( "src" ), false ); - m_patchNum.loadSettings( _this, "patch" ); - m_bankNum.loadSettings( _this, "bank" ); - + QString src = _this.attribute("src"); + if(!src.isEmpty()) + { + openFile(src, false); + m_patchNum.loadSettings(_this, "patch"); + m_bankNum.loadSettings(_this, "bank"); + } + m_gain.loadSettings( _this, "gain" ); m_reverbOn.loadSettings( _this, "reverbOn" ); From 835a1952ffb6f7ca95ce9659da2efc1631dafc24 Mon Sep 17 00:00:00 2001 From: Itreza2 <87203566+Itreza2@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:02:03 +0200 Subject: [PATCH 2/2] style correction --- plugins/Sf2Player/Sf2Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index 4ea1bb85e74..1eb75627800 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -266,7 +266,7 @@ void Sf2Instrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) void Sf2Instrument::loadSettings( const QDomElement & _this ) { QString src = _this.attribute("src"); - if(!src.isEmpty()) + if (!src.isEmpty()) { openFile(src, false); m_patchNum.loadSettings(_this, "patch");