Use the new BaseAspect::addOnChanged in a few places

... and in some cases move it closer to the aspect setup. I kept
the original location in cases where the order possibly matters.

Change-Id: I4774ea355d0d1e3cf890676a84121195fca6d406
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2024-07-03 12:16:38 +02:00
parent bbb6053374
commit cba64c460b
20 changed files with 41 additions and 53 deletions

View File

@@ -201,11 +201,9 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
auto buildDirAspect = bc->buildDirectoryAspect();
buildDirAspect->setAutoApplyOnEditingFinished(true);
connect(buildDirAspect, &BaseAspect::changed, this, [this] {
m_configModel->flush(); // clear out config cache...;
});
buildDirAspect->addOnChanged(this, [this] { m_configModel->flush(); }); // clear config cache
connect(&m_buildConfig->buildTypeAspect, &BaseAspect::changed, this, [this] {
m_buildConfig->buildTypeAspect.addOnChanged(this, [this] {
if (!m_buildConfig->cmakeBuildSystem()->isMultiConfig()) {
CMakeConfig config;
config << CMakeConfigItem("CMAKE_BUILD_TYPE",
@@ -216,9 +214,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
});
auto qmlDebugAspect = bc->aspect<QtSupport::QmlDebuggingAspect>();
connect(qmlDebugAspect, &QtSupport::QmlDebuggingAspect::changed, this, [this] {
updateButtonState();
});
qmlDebugAspect->addOnChanged(this, [this] { updateButtonState(); });
m_warningMessageLabel = new InfoLabel({}, InfoLabel::Warning);
m_warningMessageLabel->setVisible(false);