McuSupport: default path for STM32CubeProgrammer for non-Windows

Task-number: QTCREATORBUG-25788
Change-Id: If29351eaee6f14315df2a2471d2de4c254ef1c8a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Christiaan Janssen
2021-05-27 09:34:55 +02:00
committed by christiaan.janssen
parent 588ce3a390
commit 4616c134aa

View File

@@ -194,11 +194,15 @@ static McuPackage *createRGLPackage()
static McuPackage *createStm32CubeProgrammerPackage()
{
QString defaultPath = QDir::homePath();
const QString cubePath = "/STMicroelectronics/STM32Cube/STM32CubeProgrammer/";
if (Utils::HostOsInfo::isWindowsHost()) {
const QString programPath =
findInProgramFiles("/STMicroelectronics/STM32Cube/STM32CubeProgrammer/");
const QString programPath = findInProgramFiles(cubePath);
if (!programPath.isEmpty())
defaultPath = programPath;
} else {
const QString programPath = QDir::homePath() + cubePath;
if (QFileInfo::exists(programPath))
defaultPath = programPath;
}
auto result = new McuPackage(
McuPackage::tr("STM32CubeProgrammer"),