Commit e3289b65 authored by Daniel Teske's avatar Daniel Teske Committed by Tobias Hunger
Browse files

QmlProject: Avoid crashes on adding actual process steps to deploy list



Change-Id: I3bb45142a17971d21bd7e840ee0397bd49ed4469
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent a9750d02
......@@ -35,6 +35,7 @@
#include "target.h"
#include <coreplugin/idocument.h>
#include <coreplugin/variablemanager.h>
#include <utils/qtcprocess.h>
#include <utils/qtcassert.h>
......@@ -90,8 +91,8 @@ bool ProcessStep::init()
if (!bc)
bc = target()->activeBuildConfiguration();
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
pp->setMacroExpander(bc ? bc->macroExpander() : Core::VariableManager::instance()->macroExpander());
pp->setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment());
pp->setWorkingDirectory(workingDirectory());
pp->setCommand(m_command);
pp->setArguments(m_arguments);
......@@ -245,10 +246,11 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step)
BuildConfiguration *bc = m_step->buildConfiguration();
if (!bc)
bc = m_step->target()->activeBuildConfiguration();
m_ui.command->setEnvironment(bc->environment());
Utils::Environment env = bc ? bc->environment() : Utils::Environment::systemEnvironment();
m_ui.command->setEnvironment(env);
m_ui.command->setPath(m_step->command());
m_ui.workingDirectory->setEnvironment(bc->environment());
m_ui.workingDirectory->setEnvironment(env);
m_ui.workingDirectory->setPath(m_step->workingDirectory());
m_ui.commandArgumentsLineEdit->setText(m_step->arguments());
......@@ -273,8 +275,8 @@ void ProcessStepConfigWidget::updateDetails()
BuildConfiguration *bc = m_step->buildConfiguration();
if (!bc) // iff the step is actually in the deploy list
bc = m_step->target()->activeBuildConfiguration();
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setMacroExpander(bc ? bc->macroExpander() : Core::VariableManager::instance()->macroExpander());
param.setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment());
param.setWorkingDirectory(m_step->workingDirectory());
param.setCommand(m_step->command());
......
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