From d0c5577a7b6c0a154342f5af52d8bb0919718deb Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 25 Nov 2019 18:25:10 +0100 Subject: [PATCH] McuSupport: Use new runconfiguration aspect update mechanism And do not connect to buildConfigurationChanged. It's not needed, and listens to the wrong BuildConfiguration after the first change. Change-Id: I9d5dc8593ed5610aaf64e6717a694710a137b344 Reviewed-by: Alessandro Portale --- .../mcusupport/mcusupportrunconfiguration.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp index 47e2d6af4fb..49e2d798db6 100644 --- a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp +++ b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp @@ -70,17 +70,13 @@ FlashAndRunConfiguration::FlashAndRunConfiguration(Target *target, Core::Id id) effectiveFlashAndRunCall->setLabelText(tr("Effective flash and run call:")); effectiveFlashAndRunCall->setDisplayStyle(BaseStringAspect::TextEditDisplay); - auto updateConfiguration = [target, effectiveFlashAndRunCall] { + setUpdater([target, effectiveFlashAndRunCall] { effectiveFlashAndRunCall->setValue(flashAndRunCommand(target).toUserOutput()); - }; + }); - updateConfiguration(); + update(); - connect(target->activeBuildConfiguration(), - &BuildConfiguration::buildDirectoryChanged, - this, - updateConfiguration); - connect(target->project(), &Project::displayNameChanged, this, updateConfiguration); + connect(target->project(), &Project::displayNameChanged, this, &RunConfiguration::update); } class FlashAndRunWorker : public SimpleTargetRunner