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 <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-03-22 11:56:38 +01:00
parent a52c2519e3
commit 1a4c7abb22

View File

@@ -472,7 +472,8 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
this, &CMakeBuildSettingsWidget::updateFromKit); this, &CMakeBuildSettingsWidget::updateFromKit);
connect(m_buildConfiguration, &CMakeBuildConfiguration::enabledChanged, connect(m_buildConfiguration, &CMakeBuildConfiguration::enabledChanged,
this, [this]() { this, [this]() {
setError(m_buildConfiguration->disabledReason()); if (m_buildConfiguration->isEnabled())
setError(QString());
}); });
updateSelection(); updateSelection();