Use ordered threads vector in options.

This commit is contained in:
Bartosz Taudul 2019-03-24 13:41:02 +01:00
parent e957590350
commit a633c50991

View File

@ -5603,14 +5603,14 @@ void View::DrawOptions()
auto expand = ImGui::TreeNode( "Visible threads:" ); auto expand = ImGui::TreeNode( "Visible threads:" );
#endif #endif
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled( "(%zu)", m_worker.GetThreadData().size() ); ImGui::TextDisabled( "(%zu)", m_threadOrder.size() );
if( expand ) if( expand )
{ {
auto& crash = m_worker.GetCrashEvent(); auto& crash = m_worker.GetCrashEvent();
if( ImGui::SmallButton( "Select all" ) ) if( ImGui::SmallButton( "Select all" ) )
{ {
for( const auto& t : m_worker.GetThreadData() ) for( const auto& t : m_threadOrder )
{ {
Vis( t ).visible = true; Vis( t ).visible = true;
} }
@ -5618,14 +5618,14 @@ void View::DrawOptions()
ImGui::SameLine(); ImGui::SameLine();
if( ImGui::SmallButton( "Unselect all" ) ) if( ImGui::SmallButton( "Unselect all" ) )
{ {
for( const auto& t : m_worker.GetThreadData() ) for( const auto& t : m_threadOrder )
{ {
Vis( t ).visible = false; Vis( t ).visible = false;
} }
} }
int idx = 0; int idx = 0;
for( const auto& t : m_worker.GetThreadData() ) for( const auto& t : m_threadOrder )
{ {
ImGui::PushID( idx++ ); ImGui::PushID( idx++ );
ImGui::Checkbox( m_worker.GetThreadString( t->id ), &Vis( t ).visible ); ImGui::Checkbox( m_worker.GetThreadString( t->id ), &Vis( t ).visible );