forked from qt-creator/qt-creator
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 <alessandro.portale@qt.io>
This commit is contained in:
@@ -70,17 +70,13 @@ FlashAndRunConfiguration::FlashAndRunConfiguration(Target *target, Core::Id id)
|
|||||||
effectiveFlashAndRunCall->setLabelText(tr("Effective flash and run call:"));
|
effectiveFlashAndRunCall->setLabelText(tr("Effective flash and run call:"));
|
||||||
effectiveFlashAndRunCall->setDisplayStyle(BaseStringAspect::TextEditDisplay);
|
effectiveFlashAndRunCall->setDisplayStyle(BaseStringAspect::TextEditDisplay);
|
||||||
|
|
||||||
auto updateConfiguration = [target, effectiveFlashAndRunCall] {
|
setUpdater([target, effectiveFlashAndRunCall] {
|
||||||
effectiveFlashAndRunCall->setValue(flashAndRunCommand(target).toUserOutput());
|
effectiveFlashAndRunCall->setValue(flashAndRunCommand(target).toUserOutput());
|
||||||
};
|
});
|
||||||
|
|
||||||
updateConfiguration();
|
update();
|
||||||
|
|
||||||
connect(target->activeBuildConfiguration(),
|
connect(target->project(), &Project::displayNameChanged, this, &RunConfiguration::update);
|
||||||
&BuildConfiguration::buildDirectoryChanged,
|
|
||||||
this,
|
|
||||||
updateConfiguration);
|
|
||||||
connect(target->project(), &Project::displayNameChanged, this, updateConfiguration);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FlashAndRunWorker : public SimpleTargetRunner
|
class FlashAndRunWorker : public SimpleTargetRunner
|
||||||
|
Reference in New Issue
Block a user