aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/baremetal/keiltoolchain.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2023-07-20 18:09:18 +0200
committerhjk <[email protected]>2023-07-21 06:57:26 +0000
commit0137c7f8b66a8f98d8e111bfff030ebfa2c44b07 (patch)
tree65d1f1e7584e726024a1aebae3fc699ce91ed8d5 /src/plugins/baremetal/keiltoolchain.cpp
parent6b8a70b37e287160fbb935de1920c45cd6485da2 (diff)
BareMetal: Simplify a few tests for executable compiler
Change-Id: I9d85623b09a949be88075b031fa973c218e93e80 Reviewed-by: Jarek Kobus <[email protected]>
Diffstat (limited to 'src/plugins/baremetal/keiltoolchain.cpp')
-rw-r--r--src/plugins/baremetal/keiltoolchain.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp
index 552bc3c35f3..d39dc9f03b0 100644
--- a/src/plugins/baremetal/keiltoolchain.cpp
+++ b/src/plugins/baremetal/keiltoolchain.cpp
@@ -36,14 +36,6 @@ using namespace Utils;
namespace BareMetal::Internal {
-// Helpers:
-
-static bool compilerExists(const FilePath &compilerPath)
-{
- const QFileInfo fi = compilerPath.toFileInfo();
- return fi.exists() && fi.isExecutable() && fi.isFile();
-}
-
static Abi::Architecture guessArchitecture(const FilePath &compilerPath)
{
const QFileInfo fi = compilerPath.toFileInfo();
@@ -785,14 +777,14 @@ void KeilToolChainConfigWidget::setFromToolChain()
m_compilerCommand->setFilePath(tc->compilerCommand());
m_platformCodeGenFlagsLineEdit->setText(ProcessArgs::joinArgs(tc->extraCodeModelFlags()));
m_abiWidget->setAbis({}, tc->targetAbi());
- const bool haveCompiler = compilerExists(m_compilerCommand->filePath());
+ const bool haveCompiler = m_compilerCommand->filePath().isExecutableFile();
m_abiWidget->setEnabled(haveCompiler && !tc->isAutoDetected());
}
void KeilToolChainConfigWidget::handleCompilerCommandChange()
{
const FilePath compilerPath = m_compilerCommand->filePath();
- const bool haveCompiler = compilerExists(compilerPath);
+ const bool haveCompiler = compilerPath.isExecutableFile();
if (haveCompiler) {
const auto env = Environment::systemEnvironment();
const QStringList prevExtraArgs = splitString(m_platformCodeGenFlagsLineEdit->text());