refs #905 When at least one sim plugin is disabled, sim settings component

would always reset the enabled sims setting even if nothing changed.
This commit is contained in:
Mathew Sutcliffe
2017-03-10 14:44:34 +00:00
parent c9587e5ace
commit 42a13fceff

View File

@@ -162,14 +162,16 @@ namespace BlackGui
} }
auto e = m_enabledSimulators.getThreadLocal(); auto e = m_enabledSimulators.getThreadLocal();
if (enabled && !e.contains(selected->getIdentifier())) if (enabled != e.contains(selected->getIdentifier()))
{
if (enabled)
{ {
e << selected->getIdentifier(); e << selected->getIdentifier();
m_enabledSimulators.set(e);
} }
else if (!enabled) else
{ {
e.removeAll(selected->getIdentifier()); e.removeAll(selected->getIdentifier());
}
m_enabledSimulators.set(e); m_enabledSimulators.set(e);
} }