From 4f138c1a2114defe2ef43e13bde32143dc890920 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 18 Jan 2023 09:05:03 +0100 Subject: [PATCH] Boot2Qt: Code cosmetics Avoid a macro. Change-Id: I58703581727656a16d5dd6f99ee2ce9413863e9e Reviewed-by: Christian Stenger Reviewed-by: --- src/plugins/boot2qt/qdbutils.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/plugins/boot2qt/qdbutils.cpp b/src/plugins/boot2qt/qdbutils.cpp index e430dc69fbd..6eef6191998 100644 --- a/src/plugins/boot2qt/qdbutils.cpp +++ b/src/plugins/boot2qt/qdbutils.cpp @@ -6,11 +6,11 @@ #include #include #include -#include +#include #include #include -#include +using namespace Utils; namespace Qdb { namespace Internal { @@ -27,7 +27,7 @@ static QString executableBaseName(QdbTool tool) return QString(); } -Utils::FilePath findTool(QdbTool tool) +FilePath findTool(QdbTool tool) { QString filePath = Utils::qtcEnvironmentVariable(overridingEnvironmentVariable(tool)); @@ -39,17 +39,15 @@ Utils::FilePath findTool(QdbTool tool) } if (filePath.isEmpty()) { - filePath = Utils::HostOsInfo::withExecutableSuffix( - QCoreApplication::applicationDirPath() -#ifdef Q_OS_MACOS - + QLatin1String("/../../../Tools/b2qt/") -#else - + QLatin1String("/../../b2qt/") -#endif - + executableBaseName(tool)); + filePath = QCoreApplication::applicationDirPath(); + if (HostOsInfo::isMacHost()) + filePath += "/../../../Tools/b2qt/"; + else + filePath += "/../../b2qt/"; + filePath = HostOsInfo::withExecutableSuffix(filePath + executableBaseName(tool)); } - return Utils::FilePath::fromString(QDir::cleanPath(filePath)); + return FilePath::fromUserInput(filePath); } QString overridingEnvironmentVariable(QdbTool tool)