Commit 244be85f authored by Christian Kandeler's avatar Christian Kandeler
Browse files

QbsProjectManager: Expose option to show build command lines in GUI.



Change-Id: I1407b188e72ccb7ca7b47d48f9bb3041df009b8a
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 4c221535
......@@ -103,6 +103,9 @@
\li Select \gui {Keep going} to continue building when
errors occur, if possible.
\li Select \gui {Show command lines} to print actual command lines
to the compile output pane instead of high-level descriptions.
\endlist
\endlist
......
......@@ -53,6 +53,7 @@ static const char QBS_CONFIG[] = "Qbs.Configuration";
static const char QBS_DRY_RUN[] = "Qbs.DryRun";
static const char QBS_KEEP_GOING[] = "Qbs.DryKeepGoing";
static const char QBS_MAXJOBCOUNT[] = "Qbs.MaxJobs";
static const char QBS_SHOWCOMMANDLINES[] = "Qbs.ShowCommandLines";
// --------------------------------------------------------------------
// Constants:
......@@ -181,6 +182,11 @@ bool QbsBuildStep::keepGoing() const
return m_qbsBuildOptions.keepGoing();
}
bool QbsBuildStep::showCommandLines() const
{
return m_qbsBuildOptions.showCommandLines();
}
int QbsBuildStep::maxJobs() const
{
if (m_qbsBuildOptions.maxJobCount() > 0)
......@@ -197,6 +203,7 @@ bool QbsBuildStep::fromMap(const QVariantMap &map)
m_qbsBuildOptions.setDryRun(map.value(QLatin1String(QBS_DRY_RUN)).toBool());
m_qbsBuildOptions.setKeepGoing(map.value(QLatin1String(QBS_KEEP_GOING)).toBool());
m_qbsBuildOptions.setMaxJobCount(map.value(QLatin1String(QBS_MAXJOBCOUNT)).toInt());
m_qbsBuildOptions.setShowCommandLines(map.value(QLatin1String(QBS_SHOWCOMMANDLINES)).toBool());
return true;
}
......@@ -207,6 +214,7 @@ QVariantMap QbsBuildStep::toMap() const
map.insert(QLatin1String(QBS_DRY_RUN), m_qbsBuildOptions.dryRun());
map.insert(QLatin1String(QBS_KEEP_GOING), m_qbsBuildOptions.keepGoing());
map.insert(QLatin1String(QBS_MAXJOBCOUNT), m_qbsBuildOptions.maxJobCount());
map.insert(QLatin1String(QBS_SHOWCOMMANDLINES), m_qbsBuildOptions.showCommandLines());
return map;
}
......@@ -351,6 +359,14 @@ void QbsBuildStep::setMaxJobs(int jobcount)
emit qbsBuildOptionsChanged();
}
void QbsBuildStep::setShowCommandLines(bool show)
{
if (m_qbsBuildOptions.showCommandLines() == show)
return;
m_qbsBuildOptions.setShowCommandLines(show);
emit qbsBuildOptionsChanged();
}
void QbsBuildStep::parseProject()
{
m_parsingProject = true;
......@@ -426,6 +442,8 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool)));
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool)));
connect(m_ui->jobSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeJobCount(int)));
connect(m_ui->showCommandLinesCheckBox, &QCheckBox::toggled, this,
&QbsBuildStepConfigWidget::changeShowCommandLines);
connect(m_ui->propertyEdit, SIGNAL(propertiesChanged()), this, SLOT(changeProperties()));
connect(m_ui->qmlDebuggingLibraryCheckBox, SIGNAL(toggled(bool)),
this, SLOT(linkQmlDebuggingLibraryChecked(bool)));
......@@ -450,6 +468,7 @@ void QbsBuildStepConfigWidget::updateState()
m_ui->dryRunCheckBox->setChecked(m_step->dryRun());
m_ui->keepGoingCheckBox->setChecked(m_step->keepGoing());
m_ui->jobSpinBox->setValue(m_step->maxJobs());
m_ui->showCommandLinesCheckBox->setChecked(m_step->showCommandLines());
updatePropertyEdit(m_step->qbsConfiguration());
m_ui->qmlDebuggingLibraryCheckBox->setChecked(m_step->isQmlDebuggingEnabled());
}
......@@ -467,6 +486,8 @@ void QbsBuildStepConfigWidget::updateState()
command += QLatin1String("--dry-run ");
if (m_step->keepGoing())
command += QLatin1String("--keep-going ");
if (m_step->showCommandLines())
command += QLatin1String("--show-command-lines ");
command += QString::fromLatin1("--jobs %1 ").arg(m_step->maxJobs());
command += QString::fromLatin1("%1 profile:%2").arg(buildVariant, m_step->profile());
......@@ -538,6 +559,13 @@ void QbsBuildStepConfigWidget::changeDryRun(bool dr)
m_ignoreChange = false;
}
void QbsBuildStepConfigWidget::changeShowCommandLines(bool show)
{
m_ignoreChange = true;
m_step->setShowCommandLines(show);
m_ignoreChange = false;
}
void QbsBuildStepConfigWidget::changeKeepGoing(bool kg)
{
m_ignoreChange = true;
......
......@@ -67,6 +67,7 @@ public:
bool dryRun() const;
bool keepGoing() const;
bool showCommandLines() const;
int maxJobs() const;
QString buildVariant() const;
......@@ -97,6 +98,7 @@ private:
void setDryRun(bool dr);
void setKeepGoing(bool kg);
void setMaxJobs(int jobcount);
void setShowCommandLines(bool show);
void parseProject();
void build();
......@@ -139,6 +141,7 @@ private slots:
void changeBuildVariant(int);
void changeDryRun(bool dr);
void changeShowCommandLines(bool show);
void changeKeepGoing(bool kg);
void changeJobCount(int count);
void changeProperties();
......
......@@ -180,6 +180,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showCommandLinesCheckBox">
<property name="text">
<string>Show command lines</string>
</property>
</widget>
</item>
<item>
<spacer name="checkBoxSpacer">
<property name="orientation">
......
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