From 0137c7f8b66a8f98d8e111bfff030ebfa2c44b07 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 20 Jul 2023 18:09:18 +0200 Subject: BareMetal: Simplify a few tests for executable compiler Change-Id: I9d85623b09a949be88075b031fa973c218e93e80 Reviewed-by: Jarek Kobus --- src/plugins/baremetal/keiltoolchain.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/plugins/baremetal/keiltoolchain.cpp') 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()); -- cgit v1.2.3