Replace some uses of HostOsInfo::withExecutableSuffix with FilePath

Change-Id: Id72e9fd04dd4995ff2775ee919f747018cbcc339
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-08-11 08:28:29 +02:00
parent d12861ea91
commit bd4a501f15
12 changed files with 19 additions and 20 deletions

View File

@@ -417,8 +417,8 @@ static QString filled(const QString &s, int min)
QString PluginManager::systemInformation()
{
QString result;
CommandLine qtDiag(FilePath::fromString(HostOsInfo::withExecutableSuffix(
QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qtdiag")));
CommandLine qtDiag(FilePath::fromString(QLibraryInfo::location(QLibraryInfo::BinariesPath))
.pathAppended("qtdiag").withExecutableSuffix());
QtcProcess qtDiagProc;
qtDiagProc.setCommand(qtDiag);
qtDiagProc.runBlocking();

View File

@@ -214,7 +214,7 @@ bool AndroidDeployQtStep::init()
TaskHub::addTask(DeploymentTask(Task::Error, error));
return false;
}
m_command = m_command.pathAppended(HostOsInfo::withExecutableSuffix("androiddeployqt"));
m_command = m_command.pathAppended("androiddeployqt").withExecutableSuffix();
m_workingDirectory = bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY);

View File

@@ -745,8 +745,8 @@ void AndroidRunnerWorker::handleJdbWaiting()
}
m_afterFinishAdbCommands.push_back(removeForward.join(' '));
auto jdbPath = AndroidConfigurations::currentConfig().openJDKLocation().pathAppended("bin");
jdbPath = jdbPath.pathAppended(Utils::HostOsInfo::withExecutableSuffix("jdb"));
FilePath jdbPath = AndroidConfigurations::currentConfig().openJDKLocation()
.pathAppended("bin/jdb").withExecutableSuffix();
QStringList jdbArgs("-connect");
jdbArgs << QString("com.sun.jdi.SocketAttach:hostname=localhost,port=%1")

View File

@@ -125,7 +125,7 @@ static FilePath ensureExeEnding(const FilePath &file)
{
if (!HostOsInfo::isWindowsHost() || file.isEmpty() || file.toString().toLower().endsWith(".exe"))
return file;
return FilePath::fromString(HostOsInfo::withExecutableSuffix(file.toString()));
return file.withExecutableSuffix();
}
void TestConfiguration::completeTestInformation(ProjectExplorer::RunConfiguration *rc,

View File

@@ -43,6 +43,8 @@
#include <QJsonObject>
#include <QVariant>
using namespace Utils;
namespace McuSupport {
namespace Internal {
namespace Sdk {
@@ -65,7 +67,7 @@ McuPackage *createQtForMCUsPackage()
auto result = new McuPackage(
McuPackage::tr("Qt for MCUs SDK"),
QDir::homePath(),
Utils::HostOsInfo::withExecutableSuffix("bin/qmltocpp"),
FilePath("bin/qmltocpp").withExecutableSuffix().toString(),
Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK);
result->setEnvironmentVariableName("Qul_DIR");
return result;

View File

@@ -205,7 +205,7 @@ FilePath nimblePathFromKit(Kit *kit)
// There's no extra setting for "nimble", derive it from the "nim" path.
const QString nimbleFromPath = QStandardPaths::findExecutable("nimble");
const FilePath nimPath = nimPathFromKit(kit);
const FilePath nimbleFromKit = nimPath.pathAppended(HostOsInfo::withExecutableSuffix("nimble"));
const FilePath nimbleFromKit = nimPath.pathAppended("nimble").withExecutableSuffix();
return nimbleFromKit.exists() ? nimbleFromKit.canonicalPath() : FilePath::fromString(nimbleFromPath);
}

View File

@@ -213,7 +213,7 @@ CommandLine NimCompilerBuildStep::commandLine()
FilePath NimCompilerBuildStep::outFilePath() const
{
const QString targetName = m_targetNimFile.baseName();
return buildDirectory().pathAppended(HostOsInfo::withExecutableSuffix(targetName));
return buildDirectory().pathAppended(targetName).withExecutableSuffix();
}
void NimCompilerBuildStep::updateTargetNimFile()

View File

@@ -391,11 +391,10 @@ static void addPythonsFromRegistry(QList<Interpreter> &pythons)
regVal = pythonRegistry.value("InstallPath/.");
if (regVal.isValid()) {
const FilePath &path = FilePath::fromUserInput(regVal.toString());
const FilePath &python = path.pathAppended(HostOsInfo::withExecutableSuffix("python"));
const FilePath python = path.pathAppended("python").withExecutableSuffix();
if (python.exists() && !alreadyRegistered(pythons, python))
pythons << Interpreter(python, "Python " + versionGroup);
const FilePath &pythonw = path.pathAppended(
HostOsInfo::withExecutableSuffix("pythonw"));
const FilePath pythonw = path.pathAppended("pythonw").withExecutableSuffix();
if (pythonw.exists() && !alreadyRegistered(pythons, pythonw))
pythons << Interpreter(pythonw, "Python " + versionGroup, true);
}

View File

@@ -201,7 +201,7 @@ Kit *QbsProjectImporter::createKit(void *directoryData) const
qCDebug(qbsPmLog) << "creating kit for imported build" << bgData->bgFilePath.toUserOutput();
QtVersionData qtVersionData;
if (!bgData->qtBinPath.isEmpty()) {
const FilePath qmakeFilePath = bgData->qtBinPath.pathAppended(HostOsInfo::withExecutableSuffix("qmake"));
const FilePath qmakeFilePath = bgData->qtBinPath.pathAppended("qmake").withExecutableSuffix();
qtVersionData = findOrCreateQtVersion(qmakeFilePath);
}
return createTemporaryKit(qtVersionData,[this, bgData](Kit *k) -> void {

View File

@@ -374,7 +374,7 @@ static Utils::FilePath pathForBinPuppet(ProjectExplorer::Target *target)
QtSupport::BaseQtVersion *currentQtVersion = QtSupport::QtKitAspect::qtVersion(target->kit());
if (currentQtVersion)
return currentQtVersion->binPath() / Utils::HostOsInfo::withExecutableSuffix("qml2puppet");
return currentQtVersion->binPath().pathAppended("qml2puppet").withExecutableSuffix();
return {};
}

View File

@@ -400,9 +400,7 @@ void QnxConfiguration::setDefaultConfiguration(const Utils::FilePath &envScript)
m_qnxHost = FilePath::fromString(item.value).canonicalPath();
}
FilePath qccPath = FilePath::fromString(HostOsInfo::withExecutableSuffix(
m_qnxHost.toString() + QLatin1String("/usr/bin/qcc")));
const FilePath qccPath = m_qnxHost.pathAppended("usr/bin/qcc").withExecutableSuffix();
if (qccPath.exists())
m_qccCompiler = qccPath;

View File

@@ -1044,9 +1044,9 @@ FilePath BaseQtVersion::qmlRuntimeFilePath() const
FilePath path = binPath();
if (qtVersion() >= QtVersionNumber(6, 2, 0))
path = path / HostOsInfo::withExecutableSuffix("qml");
path = path.pathAppended("qml").withExecutableSuffix();
else
path = path / HostOsInfo::withExecutableSuffix("qmlscene");
path = path.pathAppended("qmlscene").withExecutableSuffix();
d->m_qmlRuntimePath = path.isExecutableFile() ? path : FilePath();
@@ -1061,7 +1061,7 @@ FilePath BaseQtVersion::qmlplugindumpFilePath() const
if (!d->m_qmlplugindumpPath.isEmpty())
return d->m_qmlplugindumpPath;
const FilePath path = binPath() / HostOsInfo::withExecutableSuffix("qmlplugindump");
const FilePath path = binPath().pathAppended("qmlplugindump").withExecutableSuffix();
d->m_qmlplugindumpPath = path.isExecutableFile() ? path : FilePath();
return d->m_qmlplugindumpPath;