Boot2Qt: Code cosmetics

Avoid a macro.

Change-Id: I58703581727656a16d5dd6f99ee2ce9413863e9e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-01-18 09:05:03 +01:00
parent bb6764d065
commit 4f138c1a21

View File

@@ -6,11 +6,11 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h> #include <coreplugin/messagemanager.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/fileutils.h> #include <utils/filepath.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QDir> using namespace Utils;
namespace Qdb { namespace Qdb {
namespace Internal { namespace Internal {
@@ -27,7 +27,7 @@ static QString executableBaseName(QdbTool tool)
return QString(); return QString();
} }
Utils::FilePath findTool(QdbTool tool) FilePath findTool(QdbTool tool)
{ {
QString filePath = Utils::qtcEnvironmentVariable(overridingEnvironmentVariable(tool)); QString filePath = Utils::qtcEnvironmentVariable(overridingEnvironmentVariable(tool));
@@ -39,17 +39,15 @@ Utils::FilePath findTool(QdbTool tool)
} }
if (filePath.isEmpty()) { if (filePath.isEmpty()) {
filePath = Utils::HostOsInfo::withExecutableSuffix( filePath = QCoreApplication::applicationDirPath();
QCoreApplication::applicationDirPath() if (HostOsInfo::isMacHost())
#ifdef Q_OS_MACOS filePath += "/../../../Tools/b2qt/";
+ QLatin1String("/../../../Tools/b2qt/") else
#else filePath += "/../../b2qt/";
+ QLatin1String("/../../b2qt/") filePath = HostOsInfo::withExecutableSuffix(filePath + executableBaseName(tool));
#endif
+ executableBaseName(tool));
} }
return Utils::FilePath::fromString(QDir::cleanPath(filePath)); return FilePath::fromUserInput(filePath);
} }
QString overridingEnvironmentVariable(QdbTool tool) QString overridingEnvironmentVariable(QdbTool tool)