Commit d144ea58 authored by Tobias Hunger's avatar Tobias Hunger

Project: Add setRootProjectNode method

Add setRootProjectNode method and a default implementation of
rootProjectNode to Project. Use that in all derived classes.

Change-Id: Id28cde04457a20a8963d43020785ef9d77fea57c
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 219b2d9c
......@@ -78,24 +78,18 @@ AutotoolsProject::AutotoolsProject(AutotoolsManager *manager, const QString &fil
setId(Constants::AUTOTOOLS_PROJECT_ID);
setProjectManager(manager);
setDocument(new AutotoolsProjectFile(fileName));
m_rootNode = new AutotoolsProjectNode(projectFilePath());
setRootProjectNode(new AutotoolsProjectNode(projectFilePath()));
setProjectContext(Core::Context(Constants::PROJECT_CONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
const QFileInfo fileInfo = projectFilePath().toFileInfo();
m_projectName = fileInfo.absoluteDir().dirName();
m_rootNode->setDisplayName(fileInfo.absoluteDir().dirName());
rootProjectNode()->setDisplayName(m_projectName);
}
AutotoolsProject::~AutotoolsProject()
{
// Although ProjectExplorer::ProjectNode is a QObject, the ctor
// does not allow to specify the parent. Manually setting the
// parent would be possible, but we use the same approach as in the
// other project managers and delete the node manually (TBD).
//
delete m_rootNode;
m_rootNode = 0;
setRootProjectNode(0);
if (m_makefileParserThread != 0) {
m_makefileParserThread->wait();
......@@ -114,11 +108,6 @@ QString AutotoolsProject::defaultBuildDirectory(const QString &projectPath)
return QFileInfo(projectPath).absolutePath();
}
ProjectNode *AutotoolsProject::rootProjectNode() const
{
return m_rootNode;
}
QStringList AutotoolsProject::files(FilesMode fileMode) const
{
Q_UNUSED(fileMode);
......@@ -261,7 +250,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
// This allows to reuse existing nodes and to remove obsolete
// nodes later.
QHash<QString, Node *> nodeHash;
foreach (Node * node, nodes(m_rootNode))
foreach (Node *node, nodes(rootProjectNode()))
nodeHash.insert(node->filePath().toString(), node);
// Add the sources to the filenode project tree. Sources
......@@ -291,7 +280,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
parentFolder = insertFolderNode(QDir(subDir), nodeHash);
if (parentFolder == 0) {
// No node gets created for the root folder
parentFolder = m_rootNode;
parentFolder = rootProjectNode();
}
}
QTC_ASSERT(parentFolder, return);
......@@ -332,7 +321,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
FolderNode *grandParent = parent->parentFolderNode();
grandParent->removeFolderNodes(QList<FolderNode *>() << parent);
parent = grandParent;
if (parent == m_rootNode)
if (parent == rootProjectNode())
break;
}
}
......@@ -343,7 +332,7 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
FolderNode *AutotoolsProject::insertFolderNode(const QDir &nodeDir, QHash<QString, Node *> &nodes)
{
const Utils::FileName nodePath = Utils::FileName::fromString(nodeDir.absolutePath());
QFileInfo rootInfo = m_rootNode->filePath().toFileInfo();
QFileInfo rootInfo = rootProjectNode()->filePath().toFileInfo();
const Utils::FileName rootPath = Utils::FileName::fromString(rootInfo.absolutePath());
// Do not create a folder for the root node
......@@ -356,7 +345,7 @@ FolderNode *AutotoolsProject::insertFolderNode(const QDir &nodeDir, QHash<QStrin
// Get parent-folder. If it does not exist, create it recursively.
// Take care that the m_rootNode is considered as top folder.
FolderNode *parentFolder = m_rootNode;
FolderNode *parentFolder = rootProjectNode();
if ((rootPath != folder->filePath()) && dir.cdUp()) {
const QString parentDir = dir.absolutePath();
if (!nodes.contains(parentDir)) {
......
......@@ -74,7 +74,6 @@ public:
~AutotoolsProject() override;
QString displayName() const override;
ProjectExplorer::ProjectNode *rootProjectNode() const override;
QStringList files(FilesMode fileMode) const override;
static QString defaultBuildDirectory(const QString &projectPath);
QStringList buildTargets() const;
......@@ -140,9 +139,6 @@ private:
/// Return value for AutotoolsProject::files()
QStringList m_files;
/// Return value for AutotoolsProject::rootProjectNode()
AutotoolsProjectNode *m_rootNode;
/// Watches project files for changes.
Utils::FileSystemWatcher *m_fileWatcher;
QStringList m_watchedFiles;
......
......@@ -88,16 +88,16 @@ using namespace Utils;
\class CMakeProject
*/
CMakeProject::CMakeProject(CMakeManager *manager, const FileName &fileName) :
m_rootNode(new CMakeProjectNode(fileName)),
m_watcher(new QFileSystemWatcher(this))
{
setId(Constants::CMAKEPROJECT_ID);
setProjectManager(manager);
setDocument(new CMakeFile(fileName));
setRootProjectNode(new CMakeProjectNode(fileName));
setProjectContext(Core::Context(CMakeProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
m_rootNode->setDisplayName(fileName.parentDir().fileName());
rootProjectNode()->setDisplayName(fileName.parentDir().fileName());
connect(this, &CMakeProject::buildTargetsChanged, this, &CMakeProject::updateRunConfigurations);
connect(m_watcher, &QFileSystemWatcher::fileChanged, this, &CMakeProject::fileChanged);
......@@ -106,7 +106,6 @@ CMakeProject::CMakeProject(CMakeManager *manager, const FileName &fileName) :
CMakeProject::~CMakeProject()
{
m_codeModelFuture.cancel();
delete m_rootNode;
}
void CMakeProject::fileChanged(const QString &fileName)
......@@ -265,7 +264,7 @@ bool CMakeProject::parseCMakeLists()
Kit *k = activeTarget()->kit();
// setFolderName
m_rootNode->setDisplayName(QFileInfo(cbpFile).completeBaseName());
rootProjectNode()->setDisplayName(QFileInfo(cbpFile).completeBaseName());
CMakeCbpParser cbpparser;
// Parsing
//qDebug()<<"Parsing file "<<cbpFile;
......@@ -282,7 +281,7 @@ bool CMakeProject::parseCMakeLists()
// how can we ensure that it is completely written?
m_watcher->addPath(cbpFile);
m_rootNode->setDisplayName(cbpparser.projectName());
rootProjectNode()->setDisplayName(cbpparser.projectName());
//qDebug()<<"Building Tree";
QList<ProjectExplorer::FileNode *> fileList = cbpparser.fileList();
......@@ -306,7 +305,7 @@ bool CMakeProject::parseCMakeLists()
m_files.append(fn->filePath().toString());
m_files.sort();
buildTree(m_rootNode, fileList);
buildTree(static_cast<CMakeProjectNode *>(rootProjectNode()), fileList);
//qDebug()<<"Adding Targets";
m_buildTargets = cbpparser.buildTargets();
......@@ -506,15 +505,9 @@ ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *
QString CMakeProject::displayName() const
{
return m_rootNode->displayName();
return rootProjectNode()->displayName();
}
ProjectExplorer::ProjectNode *CMakeProject::rootProjectNode() const
{
return m_rootNode;
}
QStringList CMakeProject::files(FilesMode fileMode) const
{
Q_UNUSED(fileMode)
......
......@@ -100,8 +100,6 @@ public:
QString displayName() const override;
ProjectExplorer::ProjectNode *rootProjectNode() const override;
QStringList files(FilesMode fileMode) const override;
QStringList buildTargetTitles(bool runnable = false) const;
QList<CMakeBuildTarget> buildTargets() const;
......@@ -149,7 +147,6 @@ private:
ProjectExplorer::Target *m_activeTarget = 0;
// TODO probably need a CMake specific node structure
Internal::CMakeProjectNode *m_rootNode;
QStringList m_files;
QList<CMakeBuildTarget> m_buildTargets;
QFileSystemWatcher *m_watcher;
......
......@@ -50,7 +50,6 @@ public:
~TestProject() override;
QString displayName() const override { return m_name; }
ProjectExplorer::ProjectNode *rootProjectNode() const override { return 0; }
QStringList files(FilesMode fileMode) const override { Q_UNUSED(fileMode); return QStringList(); }
......
......@@ -72,6 +72,7 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
setId(Constants::GENERICPROJECT_ID);
setProjectManager(manager);
setDocument(new GenericProjectFile(this, fileName, GenericProject::Everything));
setRootProjectNode(new GenericProjectNode(this));
setProjectContext(Context(GenericProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
......@@ -92,8 +93,6 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
DocumentManager::addDocument(m_includesIDocument);
DocumentManager::addDocument(m_configIDocument);
m_rootNode = new GenericProjectNode(this);
FileNode *projectFilesNode = new FileNode(Utils::FileName::fromString(m_filesFileName),
ProjectFileType,
/* generated = */ false);
......@@ -106,10 +105,8 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
ProjectFileType,
/* generated = */ false);
m_rootNode->addFileNodes(QList<FileNode *>()
<< projectFilesNode
<< projectIncludesNode
<< projectConfigNode);
rootProjectNode()->addFileNodes(QList<FileNode *>() << projectFilesNode
<< projectIncludesNode << projectConfigNode);
projectManager()->registerProject(this);
}
......@@ -118,8 +115,6 @@ GenericProject::~GenericProject()
{
m_codeModelFuture.cancel();
projectManager()->unregisterProject(this);
delete m_rootNode;
}
QString GenericProject::filesFileName() const
......@@ -281,7 +276,7 @@ void GenericProject::refresh(RefreshOptions options)
parseProject(options);
if (options & Files)
m_rootNode->refresh(oldFileList);
static_cast<GenericProjectNode *>(rootProjectNode())->refresh(oldFileList);
refreshCppCodeModel();
}
......@@ -392,11 +387,6 @@ Manager *GenericProject::projectManager() const
return static_cast<Manager *>(Project::projectManager());
}
GenericProjectNode *GenericProject::rootProjectNode() const
{
return m_rootNode;
}
QStringList GenericProject::files(FilesMode fileMode) const
{
Q_UNUSED(fileMode);
......
......@@ -63,7 +63,6 @@ public:
QString displayName() const override;
Manager *projectManager() const override;
GenericProjectNode *rootProjectNode() const override;
QStringList files(FilesMode fileMode) const override;
QStringList buildTargets() const;
......@@ -109,7 +108,6 @@ private:
QStringList m_rawProjectIncludePaths;
QStringList m_projectIncludePaths;
GenericProjectNode *m_rootNode;
QFuture<void> m_codeModelFuture;
};
......
......@@ -207,7 +207,7 @@ QString IosRunConfiguration::applicationName() const
QmakeProject *pro = qobject_cast<QmakeProject *>(target()->project());
const QmakeProFileNode *node = 0;
if (pro)
node = pro->rootQmakeProjectNode();
node = pro->rootProjectNode();
if (node)
node = node->findProFileFor(profilePath());
if (node) {
......@@ -233,7 +233,7 @@ FileName IosRunConfiguration::bundleDirectory() const
QmakeProject *pro = qobject_cast<QmakeProject *>(target()->project());
const QmakeProFileNode *node = 0;
if (pro)
node = pro->rootQmakeProjectNode();
node = pro->rootProjectNode();
if (node)
node = node->findProFileFor(profilePath());
if (node) {
......
......@@ -36,6 +36,7 @@
#include "editorconfiguration.h"
#include "kit.h"
#include "projectexplorer.h"
#include "projectnodes.h"
#include "target.h"
#include "session.h"
#include "settingsaccessor.h"
......@@ -95,6 +96,7 @@ public:
Core::Id m_id;
Core::IDocument *m_document = 0;
IProjectManager *m_manager = 0;
ProjectNode *m_rootProjectNode = 0;
QList<Target *> m_targets;
Target *m_activeTarget = 0;
EditorConfiguration m_editorConfiguration;
......@@ -111,8 +113,13 @@ public:
ProjectPrivate::~ProjectPrivate()
{
delete m_accessor;
// Make sure our root node is 0 when deleting
ProjectNode *oldNode = m_rootProjectNode;
m_rootProjectNode = 0;
delete oldNode;
delete m_document;
delete m_accessor;
}
Project::Project() : d(new ProjectPrivate)
......@@ -432,6 +439,13 @@ void Project::setProjectManager(IProjectManager *manager)
d->m_manager = manager;
}
void Project::setRootProjectNode(ProjectNode *root)
{
ProjectNode *oldNode = d->m_rootProjectNode;
d->m_rootProjectNode = root;
delete oldNode;
}
Target *Project::restoreTarget(const QVariantMap &data)
{
Core::Id id = idFromMap(data);
......@@ -522,6 +536,11 @@ IProjectManager *Project::projectManager() const
return d->m_manager;
}
ProjectNode *Project::rootProjectNode() const
{
return d->m_rootProjectNode;
}
Project::RestoreResult Project::fromMap(const QVariantMap &map, QString *errorMessage)
{
Q_UNUSED(errorMessage);
......
......@@ -88,6 +88,8 @@ public:
virtual IProjectManager *projectManager() const;
virtual ProjectNode *rootProjectNode() const;
bool hasActiveBuildSettings() const;
// EditorConfiguration:
......@@ -112,8 +114,6 @@ public:
enum class RestoreResult { Ok, Error, UserAbort };
RestoreResult restoreSettings(QString *errorMessage);
virtual ProjectNode *rootProjectNode() const = 0;
enum FilesMode { AllFiles, ExcludeGeneratedFiles };
virtual QStringList files(FilesMode fileMode) const = 0;
// TODO: generalize to find source(s) of generated files?
......@@ -175,6 +175,7 @@ protected:
void setId(Core::Id id);
void setDocument(Core::IDocument *doc); // takes ownership!
void setProjectManager(IProjectManager *manager);
void setRootProjectNode(ProjectNode *root); // takes ownership!
void setProjectContext(Core::Context context);
void setProjectLanguages(Core::Context language);
void addProjectLanguage(Core::Id id);
......
......@@ -251,7 +251,6 @@ public:
QString displayName() const override { return m_projectName; }
PythonProjectManager *projectManager() const override;
ProjectNode *rootProjectNode() const override;
QStringList files(FilesMode) const override { return m_files; }
QStringList files() const { return m_files; }
......@@ -274,8 +273,6 @@ private:
QStringList m_rawFileList;
QStringList m_files;
QHash<QString, QString> m_rawListEntries;
ProjectNode *m_rootNode;
};
class PythonProjectFile : public Core::IDocument
......@@ -620,6 +617,7 @@ PythonProject::PythonProject(PythonProjectManager *manager, const QString &fileN
setProjectManager(manager);
setDocument(new PythonProjectFile(this, fileName));
DocumentManager::addDocument(document());
setRootProjectNode(new PythonProjectNode(this));
setProjectContext(Context(PythonProjectContext));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
......@@ -627,7 +625,6 @@ PythonProject::PythonProject(PythonProjectManager *manager, const QString &fileN
QFileInfo fileInfo = projectFilePath().toFileInfo();
m_projectName = fileInfo.completeBaseName();
m_rootNode = new PythonProjectNode(this);
projectManager()->registerProject(this);
}
......@@ -635,8 +632,6 @@ PythonProject::PythonProject(PythonProjectManager *manager, const QString &fileN
PythonProject::~PythonProject()
{
projectManager()->unregisterProject(this);
delete m_rootNode;
}
PythonProjectManager *PythonProject::projectManager() const
......@@ -775,7 +770,7 @@ private:
void PythonProject::refresh()
{
m_rootNode->removeFileNodes(m_rootNode->fileNodes());
rootProjectNode()->removeFileNodes(rootProjectNode()->fileNodes());
parseProject();
QDir baseDir(projectDirectory().toString());
......@@ -786,7 +781,7 @@ void PythonProject::refresh()
fileNodes.append(new PythonFileNode(FileName::fromString(file), displayName));
}
m_rootNode->addFileNodes(fileNodes);
rootProjectNode()->addFileNodes(fileNodes);
}
/**
......@@ -844,11 +839,6 @@ QStringList PythonProject::processEntries(const QStringList &paths,
return absolutePaths;
}
ProjectNode *PythonProject::rootProjectNode() const
{
return m_rootNode;
}
Project::RestoreResult PythonProject::fromMap(const QVariantMap &map, QString *errorMessage)
{
Project::RestoreResult res = Project::fromMap(map, errorMessage);
......
......@@ -101,7 +101,6 @@ static const char CONFIG_PRECOMPILEDHEADER[] = "precompiledHeader";
QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
m_projectName(QFileInfo(fileName).completeBaseName()),
m_rootProjectNode(0),
m_qbsProjectParser(0),
m_qbsUpdateFutureInterface(0),
m_parsingScheduled(false),
......@@ -112,9 +111,9 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
setId(Constants::PROJECT_ID);
setProjectManager(manager);
setDocument(new QbsProjectFile(this, fileName));
DocumentManager::addDocument(document());
setRootProjectNode(new QbsRootProjectNode(this));
setProjectContext(Context(Constants::PROJECT_ID));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
......@@ -126,9 +125,6 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
connect(this, SIGNAL(environmentChanged()), this, SLOT(delayParsing()));
connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(startParsing()));
// NOTE: QbsProjectNode does not use this as a parent!
m_rootProjectNode = new QbsRootProjectNode(this); // needs documents to be initialized!
}
QbsProject::~QbsProject()
......@@ -141,12 +137,6 @@ QbsProject::~QbsProject()
delete m_qbsUpdateFutureInterface;
m_qbsUpdateFutureInterface = 0;
}
// Deleting the root node triggers a few things, make sure rootProjectNode
// returns 0 already
QbsProjectNode *root = m_rootProjectNode;
m_rootProjectNode = 0;
delete root;
}
QString QbsProject::displayName() const
......@@ -159,9 +149,9 @@ QbsManager *QbsProject::projectManager() const
return static_cast<QbsManager *>(Project::projectManager());
}
ProjectNode *QbsProject::rootProjectNode() const
QbsRootProjectNode *QbsProject::rootProjectNode() const
{
return m_rootProjectNode;
return static_cast<QbsRootProjectNode *>(Project::rootProjectNode());
}
static void collectFilesForProject(const qbs::ProjectData &project, QSet<QString> &result)
......@@ -286,7 +276,7 @@ bool QbsProject::addFilesToProduct(QbsBaseProjectNode *node, const QStringList &
m_projectData = m_qbsProject.projectData();
QbsGroupNode::setupFiles(node, reRetrieveGroupData(productData, groupData),
allPaths, QFileInfo(productFilePath).absolutePath(), true);
m_rootProjectNode->update();
rootProjectNode()->update();
emit fileListChanged();
}
return notAdded->isEmpty();
......@@ -315,7 +305,7 @@ bool QbsProject::removeFilesFromProduct(QbsBaseProjectNode *node, const QStringL
m_projectData = m_qbsProject.projectData();
QbsGroupNode::setupFiles(node, reRetrieveGroupData(productData, groupData), allPaths,
QFileInfo(productFilePath).absolutePath(), true);
m_rootProjectNode->update();
rootProjectNode()->update();
emit fileListChanged();
}
return notRemoved->isEmpty();
......@@ -454,7 +444,7 @@ void QbsProject::handleQbsParsingDone(bool success)
if (projectData != m_projectData) {
m_projectData = projectData;
m_rootProjectNode->update();
rootProjectNode()->update();
updateDocuments(m_qbsProject.isValid()
? m_qbsProject.buildSystemFiles() : QSet<QString>() << projectFilePath().toString());
......@@ -767,7 +757,7 @@ void QbsProject::updateCppCodeModel()
foreach (const QString &file, grp.allFilePaths()) {
if (file.endsWith(QLatin1String(".ui"))) {
QStringList generated = m_rootProjectNode->qbsProject()
QStringList generated = rootProjectNode()->qbsProject()
.generatedFiles(prd, file, QStringList(QLatin1String("hpp")));
if (generated.count() == 1)
uiFiles.insert(file, generated.at(0));
......
......@@ -33,6 +33,8 @@
#include "qbsprojectmanager.h"
#include "qbsnodes.h"
#include <cpptools/cppprojects.h>
#include <projectexplorer/project.h>
......@@ -53,7 +55,6 @@ namespace QbsProjectManager {
namespace Internal {
class QbsBaseProjectNode;
class QbsProjectNode;
class QbsRootProjectNode;
class QbsProjectParser;
class QbsBuildConfiguration;
......@@ -67,8 +68,7 @@ public:
QString displayName() const override;
QbsManager *projectManager() const override;
ProjectExplorer::ProjectNode *rootProjectNode() const override;
QbsRootProjectNode *rootProjectNode() const override;
QStringList files(FilesMode fileMode) const override;
......@@ -149,7 +149,6 @@ private:
qbs::Project m_qbsProject;
qbs::ProjectData m_projectData;
QSet<Core::IDocument *> m_qbsDocuments;
QbsRootProjectNode *m_rootProjectNode;
QbsProjectParser *m_qbsProjectParser;
......
......@@ -123,7 +123,7 @@ QmakeProjectManager::QmakeProFileNode *AndroidExtraLibraryListModel::activeNode(
if (!qarc)
return 0;
auto project = static_cast<QmakeProject *>(m_target->project());
return project->rootQmakeProjectNode()->findProFileFor(qarc->proFilePath());
return project->rootProjectNode()->findProFileFor(qarc->proFilePath());
}
void AndroidExtraLibraryListModel::proFileUpdated(QmakeProjectManager::QmakeProFileNode *node)
......
......@@ -211,7 +211,7 @@ CreateAndroidManifestWizard::CreateAndroidManifestWizard(ProjectExplorer::Target
const QmakeProFileNode *currentRunNode = 0;
ProjectExplorer::RunConfiguration *rc = target->activeRunConfiguration();
if (auto qrc = qobject_cast<QmakeAndroidRunConfiguration *>(rc))
currentRunNode = project->rootQmakeProjectNode()->findProFileFor(qrc->proFilePath());
currentRunNode = project->rootProjectNode()->findProFileFor(qrc->proFilePath());
if (nodes.isEmpty()) {
// oh uhm can't create anything
......
......@@ -158,7 +158,7 @@ Utils::FileName QmakeAndroidBuildApkStep::androidPackageSourceDir() const
{
QmakeProjectManager::QmakeProject *pro = static_cast<QmakeProjectManager::QmakeProject *>(project());
const QmakeProjectManager::QmakeProFileNode *node
= pro->rootQmakeProjectNode()->findProFileFor(proFilePathForInputFile());
= pro->rootProjectNode()->findProFileFor(proFilePathForInputFile());
if (!node)
return Utils::FileName();
return Utils::FileName::fromString(node->singleVariableValue(QmakeProjectManager::AndroidPackageSourceDir));
......@@ -199,7 +199,7 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
QString outputDir = bc->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)).toString();
const auto *pro = static_cast<QmakeProjectManager::QmakeProject *>(project());
const QmakeProjectManager::QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(proFilePathForInputFile());
const QmakeProjectManager::QmakeProFileNode *node = pro->rootProjectNode()->findProFileFor(proFilePathForInputFile());
m_skipBuilding = !node;
if (m_skipBuilding)
return true;
......
......@@ -112,7 +112,7 @@ QVariantMap QmakeAndroidRunConfiguration::toMap() const
QString QmakeAndroidRunConfiguration::defaultDisplayName()
{
auto project = static_cast<QmakeProject *>(target()->project());
const QmakeProjectManager::QmakeProFileNode *root = project->rootQmakeProjectNode();
const QmakeProjectManager::QmakeProFileNode *root = project->rootProjectNode();
if (root) {
const QmakeProjectManager::QmakeProFileNode *node = root->findProFileFor(m_proFilePath);
if (node) // should always be found
......
......@@ -114,7 +114,7 @@ Utils::FileName QmakeAndroidSupport::androiddeployJsonPath(ProjectExplorer::Targ
return Utils::FileName();
const QmakeProFileNode *node =
pro->rootQmakeProjectNode()->findProFileFor(buildApkStep->proFilePathForInputFile());
pro->rootProjectNode()->findProFileFor(buildApkStep->proFilePathForInputFile());
if (!node) // should never happen
return Utils::FileName();
......@@ -138,7 +138,7 @@ Utils::FileName QmakeAndroidSupport::manifestSourcePath(const ProjectExplorer::T
if (auto qrc = qobject_cast<QmakeAndroidRunConfiguration *>(rc)) {
Utils::FileName proFilePath = qrc->proFilePath();
const auto project = static_cast<QmakeProjectManager::QmakeProject *>(target->project());
const QmakeProFileNode *node = project->rootQmakeProjectNode()->findProFileFor(proFilePath);
const QmakeProFileNode *node = project->rootProjectNode()->findProFileFor(proFilePath);
if (node) {
QString packageSource = node->singleVariableValue(AndroidPackageSourceDir);
if (!packageSource.isEmpty()) {
......
......@@ -352,7 +352,7 @@ bool DesktopQmakeRunConfiguration::fromMap(const QVariantMap &map)
QString DesktopQmakeRunConfiguration::executable() const
{
QmakeProject *pro = static_cast<QmakeProject *>(target()->project());
const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(m_proFilePath);
const QmakeProFileNode *node = pro->rootProjectNode()->findProFileFor(m_proFilePath);
return extractWorkingDirAndExecutable(node).second;
}
......@@ -399,7 +399,7 @@ QString DesktopQmakeRunConfiguration::workingDirectory() const
QString DesktopQmakeRunConfiguration::baseWorkingDirectory() const
{
QmakeProject *pro = static_cast<QmakeProject *>(target()->project());
const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(m_proFilePath);
const QmakeProFileNode *node = pro->rootProjectNode()->findProFileFor(m_proFilePath);
return extractWorkingDirAndExecutable(node).first;
}
......@@ -416,7 +416,7 @@ void DesktopQmakeRunConfiguration::addToBaseEnvironment(Environment &env) const
// The user could be linking to a library found via a -L/some/dir switch
// to find those libraries while actually running we explicitly prepend those
// dirs to the library search path
const QmakeProFileNode *node = static_cast<QmakeProject *>(target()->project())->rootQmakeProjectNode()->findProFileFor(m_proFilePath);
const QmakeProFileNode *node = static_cast<QmakeProject *>(target()->project())->rootProjectNode()->findProFileFor(m_proFilePath);
if (m_isUsingLibrarySearchPath && node) {
const QStringList libDirectories = node->variableValue(LibDirectoriesVar);
if (!libDirectories.isEmpty()) {
......@@ -444,7 +444,7 @@ Utils::FileName DesktopQmakeRunConfiguration::proFilePath() const
QString DesktopQmakeRunConfiguration::defaultDisplayName()
{
auto project = static_cast<QmakeProject *>(target()->project());
const QmakeProFileNode *root = project->rootQmakeProjectNode();
const QmakeProFileNode *root = project->rootProjectNode();
if (root) {
const QmakeProFileNode *node = root->findProFileFor(m_proFilePath);
if (node) // should always be found
......
......@@ -264,7 +264,7 @@ bool MakeStep::init(QList<const BuildStep *> &earlierSteps)
appendOutputParser(new QMakeParser); // make may cause qmake to be run, add last to make sure
// it has a low priority.
m_scriptTarget = (static_cast<QmakeProject *>(bc->target()->project())->rootQmakeProjectNode()->projectType() == ScriptTemplate);
m_scriptTarget = (static_cast<QmakeProject *>(bc->target()->project())->rootProjectNode()->projectType() == ScriptTemplate);
return AbstractProcessStep::init(earlierSteps);
}
......
......@@ -238,7 +238,7 @@ void QmakeBuildConfiguration::setBuildDirectory(const FileName &directory)
QString QmakeBuildConfiguration::makefile() const
{
return static_cast<QmakeProject *>(target()->project())->rootQmakeProjectNode()->makefile();
return static_cast<QmakeProject *>(target()->project())->rootProjectNode()->makefile();
}
BaseQtVersion::QmakeBuildConfigs QmakeBuildConfiguration::qmakeBuildConfiguration() const
......
......@@ -2538,7 +2538,7 @@ QString QmakeProFileNode::sourceDir() const
QString QmakeProFileNode::buildDir(QmakeBuildConfiguration *bc) const
{