Browse Source

Fix sloppy path handling in migration for old color settings

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15964
newinvert
Jon Evans 2 years ago
parent
commit
ab4d9bcb14
  1. 6
      common/settings/color_settings.cpp
  2. 3
      common/settings/json_settings.cpp

6
common/settings/color_settings.cpp

@ -254,6 +254,9 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath )
return true;
} );
// this bump shouldn't have happened; add a no-op migration to avoid future issues
registerMigration( 4, 5, []() { return true; } );
}
@ -320,9 +323,10 @@ bool COLOR_SETTINGS::migrateSchema0to1()
return true;
}
wxString filename = m_filename + wxT( "_footprints" );
wxString filename = GetFilename().BeforeLast( '.' ) + wxT( "_footprints" );
COLOR_SETTINGS* fpsettings = m_manager->AddNewColorSettings( filename );
fpsettings->SetLocation( GetLocation() );
// Start out with a clone
fpsettings->m_internals->CloneFrom( *m_internals );

3
common/settings/json_settings.cpp

@ -109,6 +109,9 @@ JSON_SETTINGS::~JSON_SETTINGS()
wxString JSON_SETTINGS::GetFullFilename() const
{
if( m_filename.BeforeLast( '.' ) == getFileExt() )
return m_filename;
return wxString( m_filename + "." + getFileExt() );
}

Loading…
Cancel
Save