From a08c49b3217e022252057aa8054c7e467b720719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sivert=20Kr=C3=B8vel?= Date: Thu, 27 Oct 2022 22:46:34 +0200 Subject: [PATCH] McuSupport: Fix version warnings Packages without version detection should not get a version warning, even if the json contains a version list. With this change, a package without version detection will not get a status with invalid version. Additionally, in the case of failed version detection, it would be helpful for the user to list the acceptable versions. The status text was updated to list these. Change-Id: I814a86c741d573732072206ef1e969790f175e6a Reviewed-by: Yasser Grimes Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/mcusupport/mcupackage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/mcusupport/mcupackage.cpp b/src/plugins/mcusupport/mcupackage.cpp index ad12f62962e..63e0fb2aadc 100644 --- a/src/plugins/mcusupport/mcupackage.cpp +++ b/src/plugins/mcusupport/mcupackage.cpp @@ -140,7 +140,7 @@ void McuPackage::updateStatus() m_status = Status::ValidPathInvalidPackage; } else if (m_versionDetector && m_detectedVersion.isEmpty()) { m_status = Status::ValidPackageVersionNotDetected; - } else if (!validVersion) { + } else if (m_versionDetector && !validVersion) { m_status = Status::ValidPackageMismatchedVersion; } else { m_status = Status::ValidPackage; @@ -223,7 +223,8 @@ QString McuPackage::statusText() const : tr("Path is empty, %1 not found.").arg(displayRequiredPath); break; case Status::ValidPackageVersionNotDetected: - response = tr("Path %1 exists, but version could not be detected.").arg(displayPackagePath); + response = tr("Path %1 exists, but version %2 could not be detected.") + .arg(displayPackagePath, displayVersions); break; } return response;