Fix component library ordering bug.

This commit is contained in:
stambaughw 2009-10-05 19:17:32 +00:00
parent 76d04d6a85
commit e39e3d5314
1 changed files with 9 additions and 2 deletions

View File

@ -24,6 +24,7 @@ void WinEDA_SchematicFrame::LoadLibraries( void )
wxFileName fn; wxFileName fn;
wxString msg, tmp, errMsg; wxString msg, tmp, errMsg;
wxString libraries_not_found; wxString libraries_not_found;
wxArrayString sortOrder;
CMP_LIBRARY_LIST::iterator i = CMP_LIBRARY::GetLibraryList().begin(); CMP_LIBRARY_LIST::iterator i = CMP_LIBRARY::GetLibraryList().begin();
@ -73,6 +74,7 @@ void WinEDA_SchematicFrame::LoadLibraries( void )
if( CMP_LIBRARY::AddLibrary( fn, errMsg ) ) if( CMP_LIBRARY::AddLibrary( fn, errMsg ) )
{ {
msg += _( " loaded" ); msg += _( " loaded" );
sortOrder.Add( fn.GetName() );
} }
else else
{ {
@ -100,10 +102,15 @@ Error: %s" ),
} }
/* Put the libraries in the correct order. */ /* Put the libraries in the correct order. */
CMP_LIBRARY::SetSortOrder( m_ComponentLibFiles ); CMP_LIBRARY::SetSortOrder( sortOrder );
CMP_LIBRARY::GetLibraryList().sort(); CMP_LIBRARY::GetLibraryList().sort();
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
wxLogDebug( wxT( "Requested component library sort order." ) );
for( size_t i = 0; i < sortOrder.GetCount(); i++ )
wxLogDebug( wxT( " " ) + sortOrder[i] );
wxLogDebug( wxT( "Component library sort order:" ) ); wxLogDebug( wxT( "Component library sort order:" ) );
for ( i = CMP_LIBRARY::GetLibraryList().begin(); for ( i = CMP_LIBRARY::GetLibraryList().begin();