forked from qt-creator/qt-creator
qmake: Simplify QmakeProFileNode::buildDir()
The optional BuildConfiguration parameter is never used. Change-Id: Ic5773616920702134848507ef2801a7723e8b65c Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -25,14 +25,12 @@
|
|||||||
|
|
||||||
#include "qmakenodes.h"
|
#include "qmakenodes.h"
|
||||||
#include "qmakeproject.h"
|
#include "qmakeproject.h"
|
||||||
#include "qmakebuildconfiguration.h"
|
|
||||||
#include "qmakerunconfigurationfactory.h"
|
#include "qmakerunconfigurationfactory.h"
|
||||||
|
|
||||||
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/profilereader.h>
|
|
||||||
#include <resourceeditor/resourcenode.h>
|
#include <resourceeditor/resourcenode.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -259,15 +257,16 @@ QString QmakeProFileNode::singleVariableValue(const Variable var) const
|
|||||||
return values.isEmpty() ? QString() : values.first();
|
return values.isEmpty() ? QString() : values.first();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmakeProFileNode::buildDir(QmakeBuildConfiguration *bc) const
|
QString QmakeProFileNode::buildDir() const
|
||||||
{
|
{
|
||||||
const QDir srcDirRoot(m_project->projectDirectory().toString());
|
if (Target *target = m_project->activeTarget()) {
|
||||||
const QString relativeDir = srcDirRoot.relativeFilePath(filePath().parentDir().toString());
|
if (BuildConfiguration *bc = target->activeBuildConfiguration()) {
|
||||||
if (!bc && m_project->activeTarget())
|
const QDir srcDirRoot(m_project->projectDirectory().toString());
|
||||||
bc = static_cast<QmakeBuildConfiguration *>(m_project->activeTarget()->activeBuildConfiguration());
|
const QString relativeDir = srcDirRoot.relativeFilePath(filePath().parentDir().toString());
|
||||||
if (!bc)
|
return QDir::cleanPath(QDir(bc->buildDirectory().toString()).absoluteFilePath(relativeDir));
|
||||||
return QString();
|
}
|
||||||
return QDir::cleanPath(QDir(bc->buildDirectory().toString()).absoluteFilePath(relativeDir));
|
}
|
||||||
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace QmakeProjectManager
|
} // namespace QmakeProjectManager
|
||||||
|
@@ -30,22 +30,13 @@
|
|||||||
|
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QMap>
|
|
||||||
|
|
||||||
namespace Utils { class FileName; }
|
namespace Utils { class FileName; }
|
||||||
namespace ProjectExplorer { class RunConfiguration; }
|
namespace ProjectExplorer { class RunConfiguration; }
|
||||||
|
|
||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
class QmakeBuildConfiguration;
|
|
||||||
class QmakeProFileNode;
|
class QmakeProFileNode;
|
||||||
class QmakeProject;
|
class QmakeProject;
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
struct InternalNode;
|
|
||||||
class PriFileEvalResult;
|
|
||||||
} // namespace Internal
|
|
||||||
|
|
||||||
// Implements ProjectNode for qmake .pri files
|
// Implements ProjectNode for qmake .pri files
|
||||||
class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::ProjectNode
|
class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::ProjectNode
|
||||||
{
|
{
|
||||||
@@ -97,12 +88,11 @@ public:
|
|||||||
AddNewInformation addNewInformation(const QStringList &files, Node *context) const override;
|
AddNewInformation addNewInformation(const QStringList &files, Node *context) const override;
|
||||||
|
|
||||||
QmakeProjectManager::ProjectType projectType() const;
|
QmakeProjectManager::ProjectType projectType() const;
|
||||||
|
QString buildDir() const;
|
||||||
|
|
||||||
QStringList variableValue(const Variable var) const;
|
QStringList variableValue(const Variable var) const;
|
||||||
QString singleVariableValue(const Variable var) const;
|
QString singleVariableValue(const Variable var) const;
|
||||||
|
|
||||||
QString buildDir(QmakeBuildConfiguration *bc = nullptr) const;
|
|
||||||
|
|
||||||
QmakeProFileNode *findProFileFor(const Utils::FileName &string) const;
|
QmakeProFileNode *findProFileFor(const Utils::FileName &string) const;
|
||||||
|
|
||||||
bool showInSimpleTree(ProjectType projectType) const;
|
bool showInSimpleTree(ProjectType projectType) const;
|
||||||
|
Reference in New Issue
Block a user