From 1a4c7abb2206e6e018b8463fc951e215c5d43e74 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 22 Mar 2021 11:56:38 +0100 Subject: [PATCH] CMakePM: Keep CMakePM error messages meaningful If CMake project parsing is failing for some reason, it's better to keep the error message with the actual error than just replacing it with "The project was not parsed successfully." This error message was also issued when the project was loading, which is a bit misleading. In order to test this: 1. Set the build type to "" (nothing) 2. Clear CMake Configuration from menu 3. Run CMake This will re-configure the project with initial cmake parameters, but "-DCMAKE_BUILD_TYPE:STRING=" will set the build type to empty, and CMakePM would try to parse 'Release' and issue: "No 'Release' CMake configuration found". The commit resets the error message when the project is loaded. Change-Id: I1a586ec19f324d75a25e8f282cab02a6934fce2b Reviewed-by: Eike Ziller --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 357efd1eb6b..0c1aa7505ce 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -472,7 +472,8 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) this, &CMakeBuildSettingsWidget::updateFromKit); connect(m_buildConfiguration, &CMakeBuildConfiguration::enabledChanged, this, [this]() { - setError(m_buildConfiguration->disabledReason()); + if (m_buildConfiguration->isEnabled()) + setError(QString()); }); updateSelection();