Commit 76152088 authored by Christian Stenger's avatar Christian Stenger Committed by hjk

Debugger: Fix race condition

When getting debugger finished after a device disconnect it might
re-enable the 'Start Debugging' button although debugging is
not possible.

Task-number: QTCREATORBUG-12585
Change-Id: I8901b440bb3e90e5f29cdeba2f6629d157c2e335
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent c898fff1
......@@ -2322,12 +2322,15 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_hiddenStopAction->setAction(m_interruptAction);
m_localsAndExpressionsWindow->setShowLocals(false);
} else if (state == DebuggerFinished) {
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
Project *project = SessionManager::startupProject();
const bool canRun = pe->canRun(project, DebugRunMode);
// We don't want to do anything anymore.
m_interruptAction->setEnabled(false);
m_continueAction->setEnabled(false);
m_exitAction->setEnabled(false);
m_startAction->setEnabled(true);
m_debugWithoutDeployAction->setEnabled(true);
m_startAction->setEnabled(canRun);
m_debugWithoutDeployAction->setEnabled(canRun);
setProxyAction(m_visibleStartAction, Core::Id(Constants::DEBUG));
m_hiddenStopAction->setAction(m_undisturbableAction);
m_codeModelSnapshot = CPlusPlus::Snapshot();
......
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