forked from qt-creator/qt-creator
QMakeStep some API cleanup
Rename arguments to allArguments(), qmakeArguments() to userArguments()
This commit is contained in:
@@ -120,8 +120,6 @@ public:
|
|||||||
// restores a BuildConfiguration with the name and adds it to the project
|
// restores a BuildConfiguration with the name and adds it to the project
|
||||||
virtual BuildConfiguration *restore() const = 0;
|
virtual BuildConfiguration *restore() const = 0;
|
||||||
|
|
||||||
// TODO display name unique, in different ways
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void availableCreationTypesChanged();
|
void availableCreationTypesChanged();
|
||||||
};
|
};
|
||||||
|
@@ -58,7 +58,7 @@ QMakeStep::QMakeStep(ProjectExplorer::BuildConfiguration *bc)
|
|||||||
QMakeStep::QMakeStep(QMakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
|
QMakeStep::QMakeStep(QMakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
|
||||||
: AbstractMakeStep(bs, bc),
|
: AbstractMakeStep(bs, bc),
|
||||||
m_forced(false),
|
m_forced(false),
|
||||||
m_qmakeArgs(bs->m_qmakeArgs)
|
m_userArgs(bs->m_userArgs)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -72,9 +72,9 @@ Qt4BuildConfiguration *QMakeStep::qt4BuildConfiguration() const
|
|||||||
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QMakeStep::arguments()
|
QStringList QMakeStep::allArguments()
|
||||||
{
|
{
|
||||||
QStringList additonalArguments = m_qmakeArgs;
|
QStringList additonalArguments = m_userArgs;
|
||||||
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << buildConfiguration()->project()->file()->fileName();
|
arguments << buildConfiguration()->project()->file()->fileName();
|
||||||
@@ -129,7 +129,7 @@ bool QMakeStep::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList args = arguments();
|
QStringList args = allArguments();
|
||||||
QString workingDirectory = qt4bc->buildDirectory();
|
QString workingDirectory = qt4bc->buildDirectory();
|
||||||
|
|
||||||
QString program = qtVersion->qmakeCommand();
|
QString program = qtVersion->qmakeCommand();
|
||||||
@@ -220,24 +220,24 @@ bool QMakeStep::processFinished(int exitCode, QProcess::ExitStatus status)
|
|||||||
|
|
||||||
void QMakeStep::setQMakeArguments(const QStringList &arguments)
|
void QMakeStep::setQMakeArguments(const QStringList &arguments)
|
||||||
{
|
{
|
||||||
m_qmakeArgs = arguments;
|
m_userArgs = arguments;
|
||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QMakeStep::qmakeArguments()
|
QStringList QMakeStep::userArguments()
|
||||||
{
|
{
|
||||||
return m_qmakeArgs;
|
return m_userArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
|
void QMakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
|
||||||
{
|
{
|
||||||
m_qmakeArgs = map.value("qmakeArgs").toStringList();
|
m_userArgs = map.value("qmakeArgs").toStringList();
|
||||||
AbstractProcessStep::restoreFromLocalMap(map);
|
AbstractProcessStep::restoreFromLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
void QMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||||
{
|
{
|
||||||
map["qmakeArgs"] = m_qmakeArgs;
|
map["qmakeArgs"] = m_userArgs;
|
||||||
AbstractProcessStep::storeIntoLocalMap(map);
|
AbstractProcessStep::storeIntoLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ void QMakeStepConfigWidget::updateTitleLabel()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList args = m_step->arguments();
|
QStringList args = m_step->allArguments();
|
||||||
// We don't want the full path to the .pro file
|
// We don't want the full path to the .pro file
|
||||||
const QString projectFileName = m_step->buildConfiguration()->project()->file()->fileName();
|
const QString projectFileName = m_step->buildConfiguration()->project()->file()->fileName();
|
||||||
int index = args.indexOf(projectFileName);
|
int index = args.indexOf(projectFileName);
|
||||||
@@ -331,7 +331,7 @@ void QMakeStepConfigWidget::update()
|
|||||||
|
|
||||||
void QMakeStepConfigWidget::init()
|
void QMakeStepConfigWidget::init()
|
||||||
{
|
{
|
||||||
QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->qmakeArguments());
|
QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments());
|
||||||
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
||||||
ProjectExplorer::BuildConfiguration *bc = m_step->buildConfiguration();
|
ProjectExplorer::BuildConfiguration *bc = m_step->buildConfiguration();
|
||||||
bool debug = QtVersion::QmakeBuildConfig(bc->value("buildConfiguration").toInt()) & QtVersion::DebugBuild;
|
bool debug = QtVersion::QmakeBuildConfig(bc->value("buildConfiguration").toInt()) & QtVersion::DebugBuild;
|
||||||
@@ -346,7 +346,7 @@ void QMakeStepConfigWidget::updateEffectiveQMakeCall()
|
|||||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||||
if (qtVersion) {
|
if (qtVersion) {
|
||||||
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
||||||
m_ui.qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + ProjectExplorer::Environment::joinArgumentList(m_step->arguments()));
|
m_ui.qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + ProjectExplorer::Environment::joinArgumentList(m_step->allArguments()));
|
||||||
} else {
|
} else {
|
||||||
m_ui.qmakeArgumentsEdit->setPlainText(tr("No valid Qt version set."));
|
m_ui.qmakeArgumentsEdit->setPlainText(tr("No valid Qt version set."));
|
||||||
}
|
}
|
||||||
|
@@ -78,11 +78,11 @@ public:
|
|||||||
virtual QString displayName();
|
virtual QString displayName();
|
||||||
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
||||||
virtual bool immutable() const;
|
virtual bool immutable() const;
|
||||||
QStringList arguments();
|
|
||||||
void setForced(bool b);
|
void setForced(bool b);
|
||||||
bool forced();
|
bool forced();
|
||||||
|
|
||||||
QStringList qmakeArguments();
|
QStringList allArguments();
|
||||||
|
QStringList userArguments();
|
||||||
void setQMakeArguments(const QStringList &arguments);
|
void setQMakeArguments(const QStringList &arguments);
|
||||||
|
|
||||||
virtual void restoreFromLocalMap(const QMap<QString, QVariant> &map);
|
virtual void restoreFromLocalMap(const QMap<QString, QVariant> &map);
|
||||||
@@ -100,7 +100,7 @@ private:
|
|||||||
QStringList m_lastEnv;
|
QStringList m_lastEnv;
|
||||||
bool m_forced;
|
bool m_forced;
|
||||||
bool m_needToRunQMake; // set in init(), read in run()
|
bool m_needToRunQMake; // set in init(), read in run()
|
||||||
QStringList m_qmakeArgs;
|
QStringList m_userArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -284,7 +284,7 @@ bool Qt4BuildConfiguration::compareBuildConfigurationToImportFrom(const QString
|
|||||||
// now compare arguments lists
|
// now compare arguments lists
|
||||||
// we have to compare without the spec/platform cmd argument
|
// we have to compare without the spec/platform cmd argument
|
||||||
// and compare that on its own
|
// and compare that on its own
|
||||||
QString actualSpec = extractSpecFromArgumentList(qs->qmakeArguments(), workingDirectory, version);
|
QString actualSpec = extractSpecFromArgumentList(qs->userArguments(), workingDirectory, version);
|
||||||
if (actualSpec.isEmpty()) {
|
if (actualSpec.isEmpty()) {
|
||||||
// Easy one the user has choosen not to override the settings
|
// Easy one the user has choosen not to override the settings
|
||||||
actualSpec = version->mkspec();
|
actualSpec = version->mkspec();
|
||||||
@@ -292,7 +292,7 @@ bool Qt4BuildConfiguration::compareBuildConfigurationToImportFrom(const QString
|
|||||||
|
|
||||||
|
|
||||||
QString parsedSpec = extractSpecFromArgumentList(result.second, workingDirectory, version);
|
QString parsedSpec = extractSpecFromArgumentList(result.second, workingDirectory, version);
|
||||||
QStringList actualArgs = removeSpecFromArgumentList(qs->qmakeArguments());
|
QStringList actualArgs = removeSpecFromArgumentList(qs->userArguments());
|
||||||
QStringList parsedArgs = removeSpecFromArgumentList(result.second);
|
QStringList parsedArgs = removeSpecFromArgumentList(result.second);
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
|
Reference in New Issue
Block a user