Commit e39e3d53 authored by stambaughw's avatar stambaughw

Fix component library ordering bug.

parent 76d04d6a
...@@ -24,6 +24,7 @@ void WinEDA_SchematicFrame::LoadLibraries( void ) ...@@ -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 ) ...@@ -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" ), ...@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment