Some more FileName::appendPath -> pathAppended() changes

Change-Id: Ia05b54f157b08353d5a9efccee48dfc212d3a489
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-05-15 14:54:25 +02:00
parent 9433b8a7e7
commit 0e4df97f90
8 changed files with 15 additions and 23 deletions

View File

@@ -318,8 +318,7 @@ bool FileInProjectFinder::findFileOrDirectory(const QString &originalPath, FileH
// check if absolute path is found in sysroot
if (!m_sysroot.isEmpty()) {
FileName sysrootPath = m_sysroot;
sysrootPath.appendPath(originalPath);
const FileName sysrootPath = m_sysroot.pathAppended(originalPath);
if (checkPath(sysrootPath.toString(), origLength, fileHandler, directoryHandler)) {
return handleSuccess(originalPath, QStringList(sysrootPath.toString()), origLength,
"in sysroot");

View File

@@ -107,7 +107,7 @@ bool FileUtils::removeRecursively(const FileName &filePath, QString *error)
QStringList fileNames = dir.entryList(QDir::Files | QDir::Hidden
| QDir::System | QDir::Dirs | QDir::NoDotAndDotDot);
foreach (const QString &fileName, fileNames) {
if (!removeRecursively(FileName(filePath).appendPath(fileName), error))
if (!removeRecursively(filePath.pathAppended(fileName), error))
return false;
}
if (!QDir::root().rmdir(dir.path())) {
@@ -205,7 +205,7 @@ bool FileUtils::isFileNewerThan(const FileName &filePath, const QDateTime &timeS
const QStringList dirContents = QDir(filePath.toString())
.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
foreach (const QString &curFileName, dirContents) {
if (isFileNewerThan(FileName(filePath).appendPath(curFileName), timeStamp))
if (isFileNewerThan(filePath.pathAppended(curFileName), timeStamp))
return true;
}
}

View File

@@ -442,9 +442,9 @@ bool AvdManagerOutputParser::parseAvd(const QStringList &deviceInfo, AndroidDevi
qCDebug(avdManagerLog) << "Avd Parsing: Cannot find ABI:" << configFile;
// Get Target
Utils::FileName avdInfoFile = avdPath.parentDir();
QString avdInfoFileName = avdPath.toFileInfo().baseName() + ".ini";
avdInfoFile.appendPath(avdInfoFileName);
const Utils::FileName
avdInfoFile = avdPath.parentDir().pathAppended(avdInfoFileName);
QSettings avdInfo(avdInfoFile.toString(), QSettings::IniFormat);
value = avdInfo.value(avdInfoTargetKey).toString();
if (!value.isEmpty())

View File

@@ -349,23 +349,19 @@ FileName AndroidConfig::sdkManagerToolPath() const
FileName AndroidConfig::avdManagerToolPath() const
{
FileName avdManagerPath = m_sdkLocation;
QString toolPath = "tools/bin/avdmanager";
if (HostOsInfo::isWindowsHost())
toolPath += ANDROID_BAT_SUFFIX;
avdManagerPath = avdManagerPath.appendPath(toolPath);
return avdManagerPath;
return m_sdkLocation.pathAppended(toolPath);
}
FileName AndroidConfig::aaptToolPath() const
{
Utils::FileName aaptToolPath = m_sdkLocation;
aaptToolPath.appendPath("build-tools");
const Utils::FileName aaptToolPath = m_sdkLocation.pathAppended("build-tools");
QString toolPath = QString("%1/aapt").arg(buildToolsVersion().toString());
if (HostOsInfo::isWindowsHost())
toolPath += QTC_HOST_EXE_SUFFIX;
aaptToolPath.appendPath(toolPath);
return aaptToolPath;
return aaptToolPath.pathAppended(toolPath);
}
FileName AndroidConfig::clangPath() const

View File

@@ -107,10 +107,8 @@ void ClangToolsProjectSettings::load()
if (message.isEmpty())
continue;
Utils::FileName fullPath = Utils::FileName::fromString(fp);
if (fullPath.toFileInfo().isRelative()) {
fullPath = m_project->projectDirectory();
fullPath.appendPath(fp);
}
if (fullPath.toFileInfo().isRelative())
fullPath = m_project->projectDirectory().pathAppended(fp);
if (!fullPath.exists())
continue;
const QString contextKind = diag.value(SETTINGS_KEY_SUPPRESSED_DIAGS_CONTEXTKIND).toString();

View File

@@ -50,6 +50,7 @@
#include <QSet>
using namespace ProjectExplorer;
using namespace Utils;
namespace CMakeProjectManager {
namespace Internal {
@@ -310,8 +311,8 @@ void BuildDirManager::clearCache()
QTC_ASSERT(m_parameters.isValid(), return);
QTC_ASSERT(!m_isHandlingError, return);
auto cmakeCache = m_parameters.workDirectory.appendPath("CMakeCache.txt");
auto cmakeFiles = m_parameters.workDirectory.appendPath("CMakeFiles");
const FileName cmakeCache = m_parameters.workDirectory.pathAppended("CMakeCache.txt");
const FileName cmakeFiles = m_parameters.workDirectory.pathAppended("CMakeFiles");
const bool mustCleanUp = cmakeCache.exists() || cmakeFiles.exists();
if (!mustCleanUp)

View File

@@ -109,7 +109,7 @@ void CMakeBuildConfiguration::initialize(const BuildInfo &info)
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"CMAKE_TOOLCHAIN_FILE",
CMakeProjectManager::CMakeConfigItem::Type::PATH,
"Android CMake toolchain file",
ndkLocation.appendPath("build/cmake/android.toolchain.cmake").toUserOutput().toUtf8()});
ndkLocation.pathAppended("build/cmake/android.toolchain.cmake").toUserOutput().toUtf8()});
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"ANDROID_ABI",
CMakeProjectManager::CMakeConfigItem::Type::STRING,
"Android ABI",

View File

@@ -194,9 +194,7 @@ bool CMakeBuildStep::init()
// Warn if doing out-of-source builds with a CMakeCache.txt is the source directory
const Utils::FileName projectDirectory = bc->target()->project()->projectDirectory();
if (bc->buildDirectory() != projectDirectory) {
Utils::FileName cmc = projectDirectory;
cmc.appendPath("CMakeCache.txt");
if (cmc.exists()) {
if (projectDirectory.pathAppended("CMakeCache.txt").exists()) {
emit addTask(Task(Task::Warning,
tr("There is a CMakeCache.txt file in \"%1\", which suggest an "
"in-source build was done before. You are now building in \"%2\", "