WebAssembly: Self-register aspects in runconfiguration

No real benefit in this particular case, but the general pattern now.

Change-Id: Ia06d3221a2ccd4b7ab429f6e045c11fffffe99ad
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-07-13 17:59:56 +02:00
parent bc2c2bbae9
commit 7c8948bef4
3 changed files with 25 additions and 16 deletions

View File

@@ -69,25 +69,28 @@ class EmrunRunConfiguration : public ProjectExplorer::RunConfiguration
{
public:
EmrunRunConfiguration(Target *target, Utils::Id id)
: RunConfiguration(target, id)
: RunConfiguration(target, id)
{
auto webBrowserAspect = addAspect<WebBrowserSelectionAspect>(target);
webBrowser.setTarget(target);
auto effectiveEmrunCall = addAspect<StringAspect>();
effectiveEmrunCall->setLabelText(Tr::tr("Effective emrun call:"));
effectiveEmrunCall->setDisplayStyle(StringAspect::TextEditDisplay);
effectiveEmrunCall->setReadOnly(true);
effectiveEmrunCall.setLabelText(Tr::tr("Effective emrun call:"));
effectiveEmrunCall.setDisplayStyle(StringAspect::TextEditDisplay);
effectiveEmrunCall.setReadOnly(true);
setUpdater([this, target, effectiveEmrunCall, webBrowserAspect] {
effectiveEmrunCall->setValue(emrunCommand(target,
buildKey(),
webBrowserAspect->currentBrowser(),
"<port>").toUserOutput());
setUpdater([this, target] {
effectiveEmrunCall.setValue(emrunCommand(target,
buildKey(),
webBrowser.currentBrowser(),
"<port>").toUserOutput());
});
connect(webBrowserAspect, &BaseAspect::changed, this, &RunConfiguration::update);
connect(&webBrowser, &BaseAspect::changed, this, &RunConfiguration::update);
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
}
private:
WebBrowserSelectionAspect webBrowser{this};
StringAspect effectiveEmrunCall{this};
};
class EmrunRunWorker : public SimpleTargetRunner