aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggerruncontrol.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2019-03-13 18:28:29 +0100
committerhjk <[email protected]>2019-03-14 08:16:57 +0000
commit7a4752bde5fb1c92e71581ded732ab08a80473ef (patch)
treeea2c2e3fed6710142690bdcf083174b335c1c56e /src/plugins/debugger/debuggerruncontrol.cpp
parent7b15dc35ebfb9bbf7c24f95da7a8d91029db11ec (diff)
Debugger: Avoid some uses of RunControl::runConfiguration()
Change-Id: I1dcf5b96e6c23e369217f38a440305abb51dcd25 Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerruncontrol.cpp')
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 47446080593..5bb4845073d 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -889,8 +889,6 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
d->runId = QString::number(++toolRunCount);
- RunConfiguration *runConfig = runControl->runConfiguration();
-
runControl->setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL_TOOLBAR);
runControl->setPromptToStop([](bool *optionalPrompt) {
return RunControl::showPromptToStopDialog(
@@ -902,8 +900,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
QString(), QString(), optionalPrompt);
});
- if (runConfig)
- m_runParameters.displayName = runConfig->displayName();
+ m_runParameters.displayName = runControl->displayName();
if (auto symbolsAspect = runControl->aspect<SymbolFileAspect>())
m_runParameters.symbolFile = symbolsAspect->value();
@@ -938,8 +935,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
if (!envBinary.isEmpty())
m_runParameters.debugger.executable = QString::fromLocal8Bit(envBinary);
- Project *project = runConfig ? runConfig->target()->project() : nullptr;
- if (project) {
+ if (Project *project = runControl->project()) {
m_runParameters.projectSourceDirectory = project->projectDirectory();
m_runParameters.projectSourceFiles = project->files(Project::SourceFiles);
}
@@ -959,6 +955,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
m_runParameters.validationErrors.append(t.description);
}
+ RunConfiguration *runConfig = runControl->runConfiguration();
if (runConfig && runConfig->property("supportsDebugger").toBool()) {
const QString mainScript = runConfig->property("mainScript").toString();
const QString interpreter = runConfig->property("interpreter").toString();