Debugger: Make showPromptToStopDialog static

No need to depend on RunControl life time here.

The isRunning test is already done outside sufficiently often.

Change-Id: I3b33444df6092f52b186bbf3a58585ad0bbb03bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-05-02 10:06:09 +02:00
parent e213585910
commit 4f6293db8f
3 changed files with 13 additions and 16 deletions

View File

@@ -483,16 +483,14 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, const DebuggerRunParame
runControl->setSupportsReRunning(!(m_rp.languages & QmlLanguage));
runControl->setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL_TOOLBAR);
runControl->setPromptToStop([&](bool *optionalPrompt) {
const QString question = tr("A debugging session is still in progress. "
"Terminating the session in the current"
" state can leave the target in an inconsistent state."
" Would you still like to terminate it?");
bool result = runControl->showPromptToStopDialog(tr("Close Debugging Session"),
question, QString(), QString(), optionalPrompt);
if (result)
disconnect(this);
return result;
runControl->setPromptToStop([](bool *optionalPrompt) {
return RunControl::showPromptToStopDialog(
DebuggerRunTool::tr("Close Debugging Session"),
DebuggerRunTool::tr("A debugging session is still in progress. "
"Terminating the session in the current"
" state can leave the target in an inconsistent state."
" Would you still like to terminate it?"),
QString(), QString(), optionalPrompt);
});
if (Internal::fixupParameters(m_rp, runControl, m_errors)) {