Eeschema: fix remapping bug on windows builds.
The Windows drive specifier C: was being interpreted as a valid URL by wxURI which was performing a URL comparison instead of a file comparison which always failed in LIB_TABLE_BASE::FindRowByURI(). Change test for URI to search string for "://" to determine if the comparison should be a URI (string) comparison or a file (wxFileName) comparison. Don't run final rescue unless the user performs the remapping.
This commit is contained in:
parent
b1b3a89f72
commit
bf44d394c3
|
@ -338,9 +338,7 @@ const LIB_TABLE_ROW* LIB_TABLE::FindRowByURI( const wxString& aURI )
|
||||||
{
|
{
|
||||||
wxString tmp = cur->rows[i].GetFullURI( true );
|
wxString tmp = cur->rows[i].GetFullURI( true );
|
||||||
|
|
||||||
wxURI uri( tmp );
|
if( tmp.Find( "://" ) != wxNOT_FOUND )
|
||||||
|
|
||||||
if( uri.HasScheme() )
|
|
||||||
{
|
{
|
||||||
if( tmp == aURI )
|
if( tmp == aURI )
|
||||||
return &cur->rows[i]; // found as URI
|
return &cur->rows[i]; // found as URI
|
||||||
|
|
|
@ -64,10 +64,19 @@ DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP( SCH_EDIT_FRAME* aParent ) :
|
||||||
|
|
||||||
void DIALOG_SYMBOL_REMAP::OnRemapSymbols( wxCommandEvent& aEvent )
|
void DIALOG_SYMBOL_REMAP::OnRemapSymbols( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
|
SCH_EDIT_FRAME* parent = dynamic_cast< SCH_EDIT_FRAME* >( GetParent() );
|
||||||
|
|
||||||
|
wxCHECK_RET( parent != nullptr, "Parent window is not type SCH_EDIT_FRAME." );
|
||||||
|
|
||||||
wxBusyCursor busy;
|
wxBusyCursor busy;
|
||||||
|
|
||||||
backupProject();
|
backupProject();
|
||||||
|
|
||||||
|
// Ignore the never show rescue setting for one last rescue of legacy symbol
|
||||||
|
// libraries before remapping to the symbol library table. This ensures the
|
||||||
|
// best remapping results.
|
||||||
|
parent->RescueLegacyProject( false );
|
||||||
|
|
||||||
// The schematic is fully loaded, any legacy library symbols have been rescued. Now
|
// The schematic is fully loaded, any legacy library symbols have been rescued. Now
|
||||||
// check to see if the schematic has not been converted to the symbol library table
|
// check to see if the schematic has not been converted to the symbol library table
|
||||||
// method for looking up symbols.
|
// method for looking up symbols.
|
||||||
|
|
|
@ -343,11 +343,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
// Convert old projects over to use symbol library table.
|
// Convert old projects over to use symbol library table.
|
||||||
if( schematic.HasNoFullyDefinedLibIds() )
|
if( schematic.HasNoFullyDefinedLibIds() )
|
||||||
{
|
{
|
||||||
// Ignore the never show rescue setting for one last rescue of legacy symbol
|
|
||||||
// libraries before remapping to the symbol library table. This ensures the
|
|
||||||
// best remapping results.
|
|
||||||
RescueLegacyProject( false );
|
|
||||||
|
|
||||||
DIALOG_SYMBOL_REMAP dlgRemap( this );
|
DIALOG_SYMBOL_REMAP dlgRemap( this );
|
||||||
|
|
||||||
dlgRemap.ShowQuasiModal();
|
dlgRemap.ShowQuasiModal();
|
||||||
|
|
Loading…
Reference in New Issue