Browse Source

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.
pull/5/merge
Wayne Stambaugh 9 years ago
parent
commit
bf44d394c3
  1. 4
      common/lib_table_base.cpp
  2. 9
      eeschema/dialogs/dialog_symbol_remap.cpp
  3. 5
      eeschema/files-io.cpp

4
common/lib_table_base.cpp

@ -338,9 +338,7 @@ const LIB_TABLE_ROW* LIB_TABLE::FindRowByURI( const wxString& aURI )
{
wxString tmp = cur->rows[i].GetFullURI( true );
wxURI uri( tmp );
if( uri.HasScheme() )
if( tmp.Find( "://" ) != wxNOT_FOUND )
{
if( tmp == aURI )
return &cur->rows[i]; // found as URI

9
eeschema/dialogs/dialog_symbol_remap.cpp

@ -64,10 +64,19 @@ DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP( SCH_EDIT_FRAME* aParent ) :
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;
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
// check to see if the schematic has not been converted to the symbol library table
// method for looking up symbols.

5
eeschema/files-io.cpp

@ -343,11 +343,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// Convert old projects over to use symbol library table.
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 );
dlgRemap.ShowQuasiModal();

Loading…
Cancel
Save