WebAssembly: Avoid use of RunControl::runConfiguration

Change-Id: I598a41ac55c595437b162582c07fd1e940202272
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2022-04-13 15:18:44 +02:00
parent cf81ff2a29
commit 75a265d67b

View File

@@ -56,15 +56,17 @@ static FilePath pythonInterpreter(const Environment &env)
return {}; return {};
} }
static CommandLine emrunCommand(const RunConfiguration *rc, const QString &browser, static CommandLine emrunCommand(const Target *target,
const QString &buildKey,
const QString &browser,
const QString &port) const QString &port)
{ {
if (BuildConfiguration *bc = rc->target()->activeBuildConfiguration()) { if (BuildConfiguration *bc = target->activeBuildConfiguration()) {
const Environment env = bc->environment(); const Environment env = bc->environment();
const FilePath emrun = env.searchInPath("emrun"); const FilePath emrun = env.searchInPath("emrun");
const FilePath emrunPy = emrun.absolutePath().pathAppended(emrun.baseName() + ".py"); const FilePath emrunPy = emrun.absolutePath().pathAppended(emrun.baseName() + ".py");
const FilePath target = rc->buildTargetInfo().targetFilePath; const FilePath targetPath = bc->buildSystem()->buildTarget(buildKey).targetFilePath;
const FilePath html = target.absolutePath() / target.baseName() + ".html"; const FilePath html = targetPath.absolutePath() / targetPath.baseName() + ".html";
QStringList args(emrunPy.path()); QStringList args(emrunPy.path());
if (!browser.isEmpty()) { if (!browser.isEmpty()) {
@@ -97,8 +99,9 @@ public:
effectiveEmrunCall->setDisplayStyle(StringAspect::TextEditDisplay); effectiveEmrunCall->setDisplayStyle(StringAspect::TextEditDisplay);
effectiveEmrunCall->setReadOnly(true); effectiveEmrunCall->setReadOnly(true);
setUpdater([this, effectiveEmrunCall, webBrowserAspect] { setUpdater([this, target, effectiveEmrunCall, webBrowserAspect] {
effectiveEmrunCall->setValue(emrunCommand(this, effectiveEmrunCall->setValue(emrunCommand(target,
buildKey(),
webBrowserAspect->currentBrowser(), webBrowserAspect->currentBrowser(),
"<port>").toUserOutput()); "<port>").toUserOutput());
}); });
@@ -121,7 +124,8 @@ public:
Runnable r; Runnable r;
const QString browserId = const QString browserId =
runControl->aspect<WebBrowserSelectionAspect>()->currentBrowser; runControl->aspect<WebBrowserSelectionAspect>()->currentBrowser;
r.command = emrunCommand(runControl->runConfiguration(), r.command = emrunCommand(runControl->target(),
runControl->buildKey(),
browserId, browserId,
QString::number(portsGatherer->findEndPoint().port())); QString::number(portsGatherer->findEndPoint().port()));
SimpleTargetRunner::doStart(r); SimpleTargetRunner::doStart(r);