mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Don't hardcode symbol library stub when converting library
Also, make sure options column is set back to blank Fixes https://gitlab.com/kicad/code/kicad/-/issues/16706
This commit is contained in:
parent
85f0dd279c
commit
43a3ed2522
@ -910,6 +910,7 @@ void PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries( wxCommandEvent& event )
|
|||||||
|
|
||||||
m_cur_grid->SetCellValue( row, COL_URI, relPath );
|
m_cur_grid->SetCellValue( row, COL_URI, relPath );
|
||||||
m_cur_grid->SetCellValue( row, COL_TYPE, kicadType );
|
m_cur_grid->SetCellValue( row, COL_TYPE, kicadType );
|
||||||
|
m_cur_grid->SetCellValue( row, COL_OPTIONS, wxEmptyString );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -936,15 +937,6 @@ bool PANEL_SYM_LIB_TABLE::convertLibrary( STRING_UTF8_MAP* aOldFileProps, const
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Write a stub file; SaveSymbol() expects something to be there already.
|
|
||||||
FILE_OUTPUTFORMATTER* formatter = new FILE_OUTPUTFORMATTER( aNewFilepath );
|
|
||||||
|
|
||||||
formatter->Print( 0, "(kicad_symbol_lib (version %d) (generator kicad_converter) (generator_version \"%s\")",
|
|
||||||
SEXPR_SYMBOL_LIB_FILE_VERSION, GetMajorMinorVersion().c_str().AsChar() );
|
|
||||||
|
|
||||||
// This will write the file
|
|
||||||
delete formatter;
|
|
||||||
|
|
||||||
oldFilePI->EnumerateSymbolLib( symbols, aOldFilePath, aOldFileProps );
|
oldFilePI->EnumerateSymbolLib( symbols, aOldFilePath, aOldFileProps );
|
||||||
|
|
||||||
// Copy non-aliases first so we can build a map from symbols to newSymbols
|
// Copy non-aliases first so we can build a map from symbols to newSymbols
|
||||||
@ -971,6 +963,9 @@ bool PANEL_SYM_LIB_TABLE::convertLibrary( STRING_UTF8_MAP* aOldFileProps, const
|
|||||||
newSymbols.back()->SetParent( symbolMap[ symbol->GetParent().lock().get() ] );
|
newSymbols.back()->SetParent( symbolMap[ symbol->GetParent().lock().get() ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a blank library
|
||||||
|
kicadPI->SaveLibrary( aNewFilepath );
|
||||||
|
|
||||||
// Finally write out newSymbols
|
// Finally write out newSymbols
|
||||||
for( LIB_SYMBOL* symbol : newSymbols )
|
for( LIB_SYMBOL* symbol : newSymbols )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user