diff options
author | Christian Stenger <[email protected]> | 2014-07-02 09:53:22 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2014-07-04 13:46:08 +0200 |
commit | 76152088e93258cdd025f49902270a7c53757633 (patch) | |
tree | 834ec03f461c66baf3f543347a1e747a0e7a4818 /src/plugins/debugger/debuggerplugin.cpp | |
parent | c898fff111904fd4d0c8539aa2968521e390e4ce (diff) |
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: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 3b8e2bc3661..ac39ec1cadd 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -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(); |