summaryrefslogtreecommitdiff
path: root/src/plugins/mcusupport/mcusupportsdk.cpp
diff options
context:
space:
mode:
authorPiotr Mućko <piotr.mucko@qt.io>2022-09-27 23:10:46 +0200
committerYasser Grimes <yasser.grimes@qt.io>2022-10-12 14:50:41 +0000
commit9b47b1575a84a35a6037d0f13649789c6298cc89 (patch)
tree9d64316178734cf49a133e08aaf83ef96dfb2464 /src/plugins/mcusupport/mcusupportsdk.cpp
parenta0af1fa9278919f978b9cd26dfad69193f2dff30 (diff)
downloadqt-creator-9b47b1575a84a35a6037d0f13649789c6298cc89.tar.gz
McuSupport: 3rd party packages creation tests
Change-Id: I0f9ed6c49b28007c617627525fc081ae9152e3f1 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/mcusupport/mcusupportsdk.cpp')
-rw-r--r--src/plugins/mcusupport/mcusupportsdk.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/plugins/mcusupport/mcusupportsdk.cpp b/src/plugins/mcusupport/mcusupportsdk.cpp
index f9213d00f7..b3f3a570cf 100644
--- a/src/plugins/mcusupport/mcusupportsdk.cpp
+++ b/src/plugins/mcusupport/mcusupportsdk.cpp
@@ -361,15 +361,12 @@ McuPackagePtr createStm32CubeProgrammerPackage(const SettingsHandler::Ptr &setti
{
FilePath defaultPath;
const QString cubePath = "STMicroelectronics/STM32Cube/STM32CubeProgrammer";
- if (HostOsInfo::isWindowsHost()) {
- const FilePath programPath = findInProgramFiles(cubePath);
- if (!programPath.isEmpty())
- defaultPath = programPath;
- } else {
- const FilePath programPath = FileUtils::homePath() / cubePath;
- if (programPath.exists())
- defaultPath = programPath;
- }
+ if (HostOsInfo::isWindowsHost())
+ defaultPath = findInProgramFiles(cubePath) / "bin";
+ else
+ defaultPath = FileUtils::homePath() / cubePath / "bin";
+ if (!defaultPath.exists())
+ FilePath defaultPath = {};
const FilePath detectionPath = FilePath::fromUserInput(
QLatin1String(Utils::HostOsInfo::isWindowsHost() ? "/bin/STM32_Programmer_CLI.exe"
@@ -386,8 +383,7 @@ McuPackagePtr createStm32CubeProgrammerPackage(const SettingsHandler::Ptr &setti
{}, // versions
"https://www.st.com/en/development-tools/stm32cubeprog.html", // download url
nullptr, // version detector
- true, // add to path
- "/bin" // relative path modifier
+ true // add to path
)};
}