Commit 74e570a8 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Qmake: Add variable choosers where variables are parsed



Change-Id: I6203ebadbc934a7ae80ae1c5ca3cfad2471b787e
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 75538aa0
......@@ -262,7 +262,7 @@ void MakeStepConfigWidget::updateDetails()
Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments());
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setMacroExpander(m_makeStep->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(tcList.at(0)->makeCommand(bc->environment()));
......
......@@ -115,6 +115,7 @@ BuildStep::BuildStep(BuildStepList *bsl, Core::Id id) :
ProjectConfiguration(bsl, id), m_enabled(true)
{
Q_ASSERT(bsl);
ctor();
}
BuildStep::BuildStep(BuildStepList *bsl, BuildStep *bs) :
......@@ -122,6 +123,15 @@ BuildStep::BuildStep(BuildStepList *bsl, BuildStep *bs) :
{
Q_ASSERT(bsl);
setDisplayName(bs->displayName());
ctor();
}
void BuildStep::ctor()
{
Utils::MacroExpander *expander = macroExpander();
expander->setDisplayName(tr("Build Step"));
expander->setAccumulating(true);
expander->registerSubProvider([this] { return projectConfiguration()->macroExpander(); });
}
bool BuildStep::fromMap(const QVariantMap &map)
......
......@@ -95,6 +95,8 @@ signals:
void enabledChanged();
private:
void ctor();
bool m_enabled;
};
......
......@@ -30,6 +30,8 @@
#include "target.h"
#include "kit.h"
#include <coreplugin/variablechooser.h>
#include <utils/macroexpander.h>
#include <QDebug>
......@@ -204,6 +206,7 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) :
connect(m_ui.commandArgumentsLineEdit, &QLineEdit::textEdited,
this, &ProcessStepConfigWidget::commandArgumentsLineEditTextEdited);
Core::VariableChooser::addSupportForChildWidgets(this, m_step->macroExpander());
}
void ProcessStepConfigWidget::updateDetails()
......
......@@ -32,6 +32,7 @@
#include "qmakebuildconfiguration.h"
#include "qmakeprojectmanagerconstants.h"
#include <coreplugin/variablechooser.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/buildsteplist.h>
......@@ -357,6 +358,8 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
this, &MakeStepConfigWidget::updateDetails);
connect(m_makeStep->target(), &Target::kitChanged, this, &MakeStepConfigWidget::updateDetails);
Core::VariableChooser::addSupportForChildWidgets(this, m_makeStep->macroExpander());
}
void MakeStepConfigWidget::activeBuildConfigurationChanged()
......
......@@ -43,6 +43,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
#include <coreplugin/variablechooser.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h>
#include <qtsupport/qtsupportconstants.h>
......@@ -634,6 +635,9 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
connect(step->target(), &Target::kitChanged, this, &QMakeStepConfigWidget::qtVersionChanged);
connect(QtVersionManager::instance(), &QtVersionManager::dumpUpdatedFor,
this, &QMakeStepConfigWidget::qtVersionChanged);
auto chooser = new Core::VariableChooser(m_ui->qmakeAdditonalArgumentsLineEdit);
chooser->addMacroExpanderProvider([step] { return step->macroExpander(); });
chooser->addSupportedWidget(m_ui->qmakeAdditonalArgumentsLineEdit);
}
QMakeStepConfigWidget::~QMakeStepConfigWidget()
......
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