From a8f27d13e65fa24b59576ac65ac3fa15bf85cd9b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 6 Mar 2023 11:16:19 +0000 Subject: [PATCH] Use name (even for fallback models) *if* it's specified in dropdown. Fixes https://gitlab.com/kicad/code/kicad/issues/12425 (cherry picked from commit 7547e550aa01eef1d45281ae6a725f9797c86420) --- eeschema/dialogs/dialog_sim_model.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index 08ca27e438..05697a2aef 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -312,10 +312,10 @@ bool DIALOG_SIM_MODEL::TransferDataFromWindow() if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( ".." ) ) path = fn.GetFullPath(); - if( dynamic_cast( &curModel() ) ) - name = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::NAME_FIELD, false ); - else if( !m_modelNameChoice->IsEmpty() ) + if( !m_modelNameChoice->IsEmpty() ) name = m_modelNameChoice->GetStringSelection().ToStdString(); + else if( dynamic_cast( &curModel() ) ) + name = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::NAME_FIELD, false ); } SIM_MODEL::SetFieldValue( m_fields, SIM_LIBRARY::LIBRARY_FIELD, path );