Commit ad9b6e4e authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Switch away from modes that become deactivated

Make sure any mode that gets disabled is no longer displayed.

Task-number: QTCREATORBUG-1107
Reviewed-by: con
parent af1b31d3
......@@ -218,6 +218,18 @@ void ModeManager::enabledStateChanged()
int index = d->m_modes.indexOf(mode);
QTC_ASSERT(index >= 0, return);
d->m_modeStack->setTabEnabled(index, mode->isEnabled());
// Make sure we leave any disabled mode to prevent possible crashes:
if (mode == currentMode() && !mode->isEnabled()) {
// This assumes that there is always at least one enabled mode.
for (int i = 0; i < d->m_modes.count(); ++i) {
if (d-> != mode &&
d->>isEnabled()) {
void ModeManager::aboutToRemoveObject(QObject *obj)
Supports Markdown
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