Commit 2543919b authored by Daniel Teske's avatar Daniel Teske
Browse files

GenericProjectManager: Fix crash for make deploy steps



Task-number: QTCREATORBUG-7183

Change-Id: Ib917c8990c698b7315ebb79083bf71623b3ae6e7
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 275e207d
......@@ -110,6 +110,8 @@ GenericBuildConfiguration *GenericMakeStep::genericBuildConfiguration() const
bool GenericMakeStep::init()
{
GenericBuildConfiguration *bc = genericBuildConfiguration();
if (!bc)
bc = static_cast<GenericBuildConfiguration *>(target()->activeBuildConfiguration());
ProjectExplorer::ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
......@@ -173,7 +175,7 @@ QString GenericMakeStep::makeCommand() const
{
QString command = m_makeCommand;
if (command.isEmpty()) {
GenericProject *pro = genericBuildConfiguration()->genericTarget()->genericProject();
GenericProject *pro = static_cast<GenericProject *>(target()->project());
if (ProjectExplorer::ToolChain *toolChain = pro->toolChain())
command = toolChain->makeCommand();
else
......@@ -224,7 +226,7 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt
m_ui->setupUi(this);
// TODO update this list also on rescans of the GenericLists.txt
GenericProject *pro = m_makeStep->genericBuildConfiguration()->genericTarget()->genericProject();
GenericProject *pro = static_cast<GenericProject *>(m_makeStep->target()->project());
foreach (const QString &target, pro->buildTargets()) {
QListWidgetItem *item = new QListWidgetItem(target, m_ui->targetsList);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
......@@ -263,6 +265,8 @@ void GenericMakeStepConfigWidget::updateMakeOverrrideLabel()
void GenericMakeStepConfigWidget::updateDetails()
{
GenericBuildConfiguration *bc = m_makeStep->genericBuildConfiguration();
if (!bc)
bc = static_cast<GenericBuildConfiguration *>(m_makeStep->target()->activeBuildConfiguration());
ProjectExplorer::ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
......
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