Fix library sort order in library viewers
The lib table returns a properly sorted list of libraries already, which we just iterate through. A std::set is a sorted collection, but uses a different sorting function than the lib table, so appending to a std::set breaks the initial sorting that was done already. Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13530
This commit is contained in:
parent
f6dc48ead7
commit
51c8f2c119
|
@ -642,8 +642,8 @@ bool SYMBOL_VIEWER_FRAME::ReCreateLibList()
|
||||||
PROJECT_FILE& project = Kiway().Prj().GetProjectFile();
|
PROJECT_FILE& project = Kiway().Prj().GetProjectFile();
|
||||||
SYMBOL_LIB_TABLE* libTable = Prj().SchSymbolLibTable();
|
SYMBOL_LIB_TABLE* libTable = Prj().SchSymbolLibTable();
|
||||||
std::vector<wxString> libs = libTable->GetLogicalLibs();
|
std::vector<wxString> libs = libTable->GetLogicalLibs();
|
||||||
std::set<wxString> pinnedMatches;
|
std::vector<wxString> pinnedMatches;
|
||||||
std::set<wxString> otherMatches;
|
std::vector<wxString> otherMatches;
|
||||||
|
|
||||||
auto doAddLib =
|
auto doAddLib =
|
||||||
[&]( const wxString& aLib )
|
[&]( const wxString& aLib )
|
||||||
|
@ -651,11 +651,11 @@ bool SYMBOL_VIEWER_FRAME::ReCreateLibList()
|
||||||
if( alg::contains( project.m_PinnedSymbolLibs, aLib )
|
if( alg::contains( project.m_PinnedSymbolLibs, aLib )
|
||||||
|| alg::contains( cfg->m_Session.pinned_symbol_libs, aLib ) )
|
|| alg::contains( cfg->m_Session.pinned_symbol_libs, aLib ) )
|
||||||
{
|
{
|
||||||
pinnedMatches.insert( aLib );
|
pinnedMatches.push_back( aLib );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
otherMatches.insert( aLib );
|
otherMatches.push_back( aLib );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -463,8 +463,8 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList()
|
||||||
COMMON_SETTINGS* cfg = Pgm().GetCommonSettings();
|
COMMON_SETTINGS* cfg = Pgm().GetCommonSettings();
|
||||||
PROJECT_FILE& project = Kiway().Prj().GetProjectFile();
|
PROJECT_FILE& project = Kiway().Prj().GetProjectFile();
|
||||||
std::vector<wxString> nicknames = Prj().PcbFootprintLibs()->GetLogicalLibs();
|
std::vector<wxString> nicknames = Prj().PcbFootprintLibs()->GetLogicalLibs();
|
||||||
std::set<wxString> pinnedMatches;
|
std::vector<wxString> pinnedMatches;
|
||||||
std::set<wxString> otherMatches;
|
std::vector<wxString> otherMatches;
|
||||||
|
|
||||||
auto process =
|
auto process =
|
||||||
[&]( const wxString& aNickname )
|
[&]( const wxString& aNickname )
|
||||||
|
@ -472,11 +472,11 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList()
|
||||||
if( alg::contains( project.m_PinnedFootprintLibs, aNickname )
|
if( alg::contains( project.m_PinnedFootprintLibs, aNickname )
|
||||||
|| alg::contains( cfg->m_Session.pinned_fp_libs, aNickname ) )
|
|| alg::contains( cfg->m_Session.pinned_fp_libs, aNickname ) )
|
||||||
{
|
{
|
||||||
pinnedMatches.insert( aNickname );
|
pinnedMatches.push_back( aNickname );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
otherMatches.insert( aNickname );
|
otherMatches.push_back( aNickname );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue