CppTools: Move RawProjectPart to ProjectExplorer

Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.

Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2019-08-28 18:22:45 +02:00
parent f52c4f450d
commit 9cc45fe1fb
36 changed files with 126 additions and 123 deletions

View File

@@ -168,12 +168,12 @@ void addDriverModeFlagIfNeeded(const ToolChain *toolchain,
}
}
CppTools::RawProjectPart makeRawProjectPart(const Utils::FilePath &projectFile,
Kit *kit,
CppTools::KitInfo &kitInfo,
const QString &workingDir,
const Utils::FilePath &fileName,
QStringList flags)
RawProjectPart makeRawProjectPart(const Utils::FilePath &projectFile,
Kit *kit,
CppTools::KitInfo &kitInfo,
const QString &workingDir,
const Utils::FilePath &fileName,
QStringList flags)
{
HeaderPaths headerPaths;
Macros macros;
@@ -188,7 +188,7 @@ CppTools::RawProjectPart makeRawProjectPart(const Utils::FilePath &projectFile,
fileKind,
kitInfo.sysRootPath);
CppTools::RawProjectPart rpp;
RawProjectPart rpp;
rpp.setProjectFileLocation(projectFile.toString());
rpp.setBuildSystemTarget(workingDir);
rpp.setDisplayName(fileName.fileName());
@@ -286,13 +286,13 @@ void addChild(FolderNode *root, const Utils::FilePath &fileName)
void createTree(std::unique_ptr<ProjectNode> &root,
const Utils::FilePath &rootPath,
const CppTools::RawProjectParts &rpps,
const RawProjectParts &rpps,
const QList<FileNode *> &scannedFiles = QList<FileNode *>())
{
root->setAbsoluteFilePathAndLine(rootPath, -1);
std::unique_ptr<FolderNode> secondRoot;
for (const CppTools::RawProjectPart &rpp : rpps) {
for (const RawProjectPart &rpp : rpps) {
for (const QString &filePath : rpp.files) {
Utils::FilePath fileName = Utils::FilePath::fromString(filePath);
if (!fileName.isChildOf(rootPath)) {
@@ -343,7 +343,7 @@ void CompilationDatabaseProject::buildTreeAndProjectParts()
// Reset toolchains to pick them based on the database entries.
kitInfo.cToolChain = nullptr;
kitInfo.cxxToolChain = nullptr;
CppTools::RawProjectParts rpps;
RawProjectParts rpps;
QTC_ASSERT(m_parser, return);
const DbContents dbContents = m_parser->dbContents();
@@ -356,12 +356,12 @@ void CompilationDatabaseProject::buildTreeAndProjectParts()
prevEntry = &entry;
CppTools::RawProjectPart rpp = makeRawProjectPart(projectFilePath(),
m_kit.get(),
kitInfo,
entry.workingDir,
entry.fileName,
entry.flags);
RawProjectPart rpp = makeRawProjectPart(projectFilePath(),
m_kit.get(),
kitInfo,
entry.workingDir,
entry.fileName,
entry.flags);
rpps.append(rpp);
}
@@ -373,7 +373,7 @@ void CompilationDatabaseProject::buildTreeAndProjectParts()
for (const QString &extra : dbContents.extras)
extraFiles.append(baseDir.pathAppended(extra).toString());
CppTools::RawProjectPart rppExtra;
RawProjectPart rppExtra;
rppExtra.setFiles(extraFiles);
rpps.append(rppExtra);
}