Commit caa8bd45 authored by Tobias Hunger's avatar Tobias Hunger

qmake: Warn when using a mkspec that might not work with the tool chain

Warn when using a mkspec that might or might not work with the selected
tool chain.

Task-number: QTCREATORBUG-5854
Change-Id: Ifead5108ccd109f66707ad7aa371daead8cb57e7
Reviewed-on: http://codereview.qt-project.org/4522Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 28535f75
......@@ -136,9 +136,12 @@ public:
: QWidget()
{}
virtual QString summaryText() const = 0;
virtual QString additionalSummaryText() const { return QString(); }
virtual QString displayName() const = 0;
signals:
void updateSummary();
void updateAdditionalSummary();
};
} // namespace ProjectExplorer
......
......@@ -140,6 +140,19 @@ void BuildStepListWidget::updateSummary()
}
}
void BuildStepListWidget::updateAdditionalSummary()
{
BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(sender());
if (widget) {
foreach (const BuildStepsWidgetData *s, m_buildStepsData) {
if (s->widget == widget) {
s->detailsWidget->setAdditionalSummaryText(widget->additionalSummaryText());
break;
}
}
}
}
void BuildStepListWidget::init(BuildStepList *bsl)
{
Q_ASSERT(bsl);
......@@ -222,6 +235,8 @@ void BuildStepListWidget::addBuildStepWidget(int pos, BuildStep *step)
connect(s->widget, SIGNAL(updateSummary()),
this, SLOT(updateSummary()));
connect(s->widget, SIGNAL(updateAdditionalSummary()),
this, SLOT(updateAdditionalSummary()));
connect(s->upButton, SIGNAL(clicked()),
m_upMapper, SLOT(map()));
......
......@@ -85,6 +85,7 @@ private slots:
void triggerAddBuildStep();
void addBuildStep(int pos);
void updateSummary();
void updateAdditionalSummary();
void triggerStepMoveUp(int pos);
void stepMoved(int from, int to);
void triggerStepMoveDown(int pos);
......
......@@ -537,6 +537,11 @@ QString QMakeStepConfigWidget::summaryText() const
return m_summaryText;
}
QString QMakeStepConfigWidget::additionalSummaryText() const
{
return m_additionalSummaryText;
}
QString QMakeStepConfigWidget::displayName() const
{
return m_step->displayName();
......@@ -664,18 +669,24 @@ void QMakeStepConfigWidget::updateSummaryLabel()
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
QtSupport::BaseQtVersion *qtVersion = qt4bc->qtVersion();
if (!qtVersion) {
m_summaryText = tr("<b>qmake:</b> No Qt version set. Cannot run qmake.");
emit updateSummary();
setSummaryText(tr("<b>qmake:</b> No Qt version set. Cannot run qmake."));
return;
}
// We don't want the full path to the .pro file
QString args = m_step->allArguments(true);
// And we only use the .pro filename not the full path
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
m_summaryText = tr("<b>qmake:</b> %1 %2").arg(program, args);
emit updateSummary();
setSummaryText(tr("<b>qmake:</b> %1 %2").arg(program, args));
ToolChain *tc = qt4bc->toolChain();
if (!tc)
return;
QString tcSpec = tc->mkspec();
if (!tcSpec.isEmpty() && tcSpec != m_step->mkspec())
setAdditionalSummaryText(tr("<b>Warning:</b> The tool chain suggested \"%1\" as mkspec.").arg(tcSpec));
else
setAdditionalSummaryText(QString());
}
void QMakeStepConfigWidget::updateQmlDebuggingOption()
......@@ -723,6 +734,22 @@ void QMakeStepConfigWidget::recompileMessageBoxFinished(int button)
}
}
void QMakeStepConfigWidget::setSummaryText(const QString &text)
{
if (text == m_summaryText)
return;
m_summaryText = text;
emit updateSummary();
}
void QMakeStepConfigWidget::setAdditionalSummaryText(const QString &text)
{
if (text == m_additionalSummaryText)
return;
m_additionalSummaryText = text;
emit updateAdditionalSummary();
}
////
// QMakeStepFactory
////
......
......@@ -143,6 +143,7 @@ public:
QMakeStepConfigWidget(QMakeStep *step);
~QMakeStepConfigWidget();
QString summaryText() const;
QString additionalSummaryText() const;
QString displayName() const;
private slots:
// slots for handling buildconfiguration/step signals
......@@ -167,9 +168,14 @@ private:
void updateSummaryLabel();
void updateQmlDebuggingOption();
void updateEffectiveQMakeCall();
void setSummaryText(const QString &);
void setAdditionalSummaryText(const QString &);
Ui::QMakeStep *m_ui;
QMakeStep *m_step;
QString m_summaryText;
QString m_additionalSummaryText;
bool m_ignoreChange;
};
......
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