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);

View File

@@ -610,11 +610,11 @@ QWidget *CMakeBuildStep::createConfigWidget()
updateDetails();
connect(&cmakeArguments, &BaseAspect::changed, this, updateDetails);
connect(&toolArguments, &BaseAspect::changed, this, updateDetails);
connect(&useStaging, &BaseAspect::changed, this, updateDetails);
connect(&stagingDir, &BaseAspect::changed, this, updateDetails);
connect(&useiOSAutomaticProvisioningUpdates, &BaseAspect::changed, this, updateDetails);
cmakeArguments.addOnChanged(this, updateDetails);
toolArguments.addOnChanged(this, updateDetails);
useStaging.addOnChanged(this, updateDetails);
stagingDir.addOnChanged(this, updateDetails);
useiOSAutomaticProvisioningUpdates.addOnChanged(this, updateDetails);
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
this, updateDetails);

View File

@@ -116,8 +116,7 @@ public:
&& isApplicable(editor->document()));
};
connect(&autoFormatMime, &Utils::StringAspect::changed,
this, updateActions);
autoFormatMime.addOnChanged(this, updateActions);
connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
this, updateActions);
connect(EditorManager::instance(), &EditorManager::aboutToSave,

View File

@@ -99,7 +99,7 @@ QWidget *CMakeInstallStep::createConfigWidget()
updateDetails();
connect(&cmakeArguments, &StringAspect::changed, this, updateDetails);
cmakeArguments.addOnChanged(this, updateDetails);
connect(ProjectExplorerPlugin::instance(),
&ProjectExplorerPlugin::settingsChanged,