More FileName::appendPath() -> .pathAppended()

Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-05-17 12:32:05 +02:00
parent 0565457b5c
commit f4c9e5e5c4
23 changed files with 39 additions and 58 deletions

View File

@@ -276,7 +276,8 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
{
CMakeConfigItem settingFileItem;
settingFileItem.key = "ANDROID_DEPLOYMENT_SETTINGS_FILE";
settingFileItem.value = bc->buildDirectory().appendPath("android_deployment_settings.json").toString().toUtf8();
settingFileItem.value = bc->buildDirectory()
.pathAppended("android_deployment_settings.json").toString().toUtf8();
patchedConfig.append(settingFileItem);
}

View File

@@ -207,9 +207,7 @@ static Utils::FileName qmakeFromCMakeCache(const CMakeConfig &config)
// Eat the leading "}/" and trailing "
const QByteArray locationPart = origLine.mid(sp + 2, ep - 2 - sp);
Utils::FileName result = baseQtDir;
result.appendPath(QString::fromUtf8(locationPart));
return result;
return baseQtDir.pathAppended(QString::fromUtf8(locationPart));
}
}
}

View File

@@ -144,8 +144,7 @@ bool CMakeListsNode::supportsAction(ProjectExplorer::ProjectAction action, const
Utils::optional<Utils::FileName> CMakeListsNode::visibleAfterAddFileAction() const
{
Utils::FileName projFile{filePath()};
return projFile.appendPath("CMakeLists.txt");
return filePath().pathAppended("CMakeLists.txt");
}
CMakeProjectNode::CMakeProjectNode(const Utils::FileName &directory) :
@@ -251,8 +250,7 @@ bool CMakeTargetNode::addFiles(const QStringList &filePaths, QStringList *)
Utils::optional<Utils::FileName> CMakeTargetNode::visibleAfterAddFileAction() const
{
Utils::FileName projFile{filePath()};
return projFile.appendPath("CMakeLists.txt");
return filePath().pathAppended("CMakeLists.txt");
}
void CMakeTargetNode::setTargetInformation(const QList<Utils::FileName> &artifacts,

View File

@@ -190,8 +190,7 @@ QVariantMap CMakeTool::toMap() const
Utils::FileName CMakeTool::cmakeExecutable() const
{
if (Utils::HostOsInfo::isMacHost() && m_executable.endsWith(".app")) {
Utils::FileName toTest = m_executable;
toTest = toTest.appendPath("Contents/bin/cmake");
const Utils::FileName toTest = m_executable.pathAppended("Contents/bin/cmake");
if (toTest.exists())
return toTest;
}

View File

@@ -813,8 +813,7 @@ static void createProjectNode(const QHash<Utils::FileName, ProjectNode *> &cmake
ProjectNode *cmln = cmakeListsNodes.value(dir);
QTC_ASSERT(cmln, qDebug() << dir.toUserOutput(); return);
Utils::FileName projectName = dir;
projectName.appendPath(".project::" + displayName);
const Utils::FileName projectName = dir.pathAppended(".project::" + displayName);
ProjectNode *pn = cmln->projectNode(projectName);
if (!pn) {
@@ -865,8 +864,7 @@ void ServerModeReader::addTargets(const QHash<Utils::FileName, ProjectExplorer::
tNode->setTargetInformation(t->artifacts, t->type);
QList<FolderNode::LocationInfo> info;
// Set up a default target path:
FileName targetPath = t->sourceDirectory;
targetPath.appendPath("CMakeLists.txt");
FileName targetPath = t->sourceDirectory.pathAppended("CMakeLists.txt");
for (CrossReference *cr : qAsConst(t->crossReferences)) {
BacktraceItem *bt = cr->backtrace.isEmpty() ? nullptr : cr->backtrace.at(0);
if (bt) {

View File

@@ -235,8 +235,7 @@ QList<CMakeBuildTarget> TeaLeafReader::takeBuildTargets()
CMakeConfig TeaLeafReader::takeParsedConfiguration()
{
FileName cacheFile = m_parameters.workDirectory;
cacheFile.appendPath(QLatin1String("CMakeCache.txt"));
const FileName cacheFile = m_parameters.workDirectory.pathAppended("CMakeCache.txt");
if (!cacheFile.exists())
return { };
@@ -432,8 +431,7 @@ void TeaLeafReader::extractData()
m_cmakeFiles.insert(cbpFile);
// Add CMakeCache.txt file:
FileName cacheFile = m_parameters.workDirectory;
cacheFile.appendPath(QLatin1String("CMakeCache.txt"));
const FileName cacheFile = m_parameters.workDirectory.pathAppended("CMakeCache.txt");
if (cacheFile.toFileInfo().exists())
m_cmakeFiles.insert(cacheFile);