forked from qt-creator/qt-creator
QmakeProject: Move QmakeBC::isShadowBuild
... to the config widget implementation, which is the only user. Change-Id: I7cc70b6219dacedf1ef431a1fe21345b9ad69e7b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -255,15 +255,6 @@ void QmakeBuildConfiguration::setFileNodeBuild(FileNode *node)
|
||||
m_fileNodeBuild = node;
|
||||
}
|
||||
|
||||
/// returns whether this is a shadow build configuration or not
|
||||
/// note, even if shadowBuild() returns true, it might be using the
|
||||
/// source directory as the shadow build directory, thus it
|
||||
/// still is a in-source build
|
||||
bool QmakeBuildConfiguration::isShadowBuild() const
|
||||
{
|
||||
return buildDirectory() != target()->project()->projectDirectory();
|
||||
}
|
||||
|
||||
QString QmakeBuildConfiguration::makefile() const
|
||||
{
|
||||
auto rootNode = dynamic_cast<QmakeProFileNode *>(target()->project()->rootProjectNode());
|
||||
|
@@ -48,7 +48,6 @@ public:
|
||||
|
||||
void initialize(const ProjectExplorer::BuildInfo &info) override;
|
||||
ProjectExplorer::NamedWidget *createConfigWidget() override;
|
||||
bool isShadowBuild() const;
|
||||
|
||||
void setSubNodeBuild(QmakeProFileNode *node);
|
||||
QmakeProFileNode *subNodeBuild() const;
|
||||
|
@@ -44,11 +44,19 @@ using namespace QmakeProjectManager;
|
||||
using namespace QmakeProjectManager::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
/// returns whether this is a shadow build configuration or not
|
||||
/// note, even if shadowBuild() returns true, it might be using the
|
||||
/// source directory as the shadow build directory, thus it
|
||||
/// still is a in-source build
|
||||
static bool isShadowBuild(BuildConfiguration *bc)
|
||||
{
|
||||
return bc->buildDirectory() != bc->target()->project()->projectDirectory();
|
||||
}
|
||||
|
||||
QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
|
||||
: NamedWidget(),
|
||||
m_buildConfiguration(bc)
|
||||
{
|
||||
const bool isShadowBuild = bc->isShadowBuild();
|
||||
Project *project = bc->target()->project();
|
||||
|
||||
m_defaultShadowBuildDir
|
||||
@@ -71,7 +79,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
|
||||
shadowBuildLabel->setText(tr("Shadow build:"));
|
||||
|
||||
shadowBuildCheckBox = new QCheckBox(details);
|
||||
shadowBuildCheckBox->setChecked(isShadowBuild);
|
||||
shadowBuildCheckBox->setChecked(isShadowBuild(m_buildConfiguration));
|
||||
|
||||
buildDirLabel = new QLabel(details);
|
||||
buildDirLabel->setText(tr("Build directory:"));
|
||||
@@ -115,7 +123,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
|
||||
shadowBuildDirEdit->setHistoryCompleter(QLatin1String("Qmake.BuildDir.History"));
|
||||
shadowBuildDirEdit->setEnvironment(bc->environment());
|
||||
shadowBuildDirEdit->setBaseFileName(project->projectDirectory());
|
||||
if (isShadowBuild) {
|
||||
if (isShadowBuild(m_buildConfiguration)) {
|
||||
shadowBuildDirEdit->setPath(bc->rawBuildDirectory().toString());
|
||||
inSourceBuildDirEdit->setVisible(false);
|
||||
} else {
|
||||
@@ -296,7 +304,7 @@ void QmakeProjectConfigWidget::updateProblemLabel()
|
||||
|
||||
if (allGood) {
|
||||
QString buildDirectory = m_buildConfiguration->target()->project()->projectDirectory().toString();
|
||||
if (m_buildConfiguration->isShadowBuild())
|
||||
if (isShadowBuild(m_buildConfiguration))
|
||||
buildDirectory = m_buildConfiguration->buildDirectory().toString();
|
||||
Tasks issues;
|
||||
issues = version->reportIssues(proFileName, buildDirectory);
|
||||
|
Reference in New Issue
Block a user