Use QtcProcess in webassembly

Change-Id: I19da9f4d9b2892256bf19655858ef585aa4825a8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Jarek Kobus
2021-11-03 17:54:53 +01:00
parent cd6d2b0cd8
commit fa1515185a

View File

@@ -30,6 +30,7 @@
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <utils/layoutbuilder.h> #include <utils/layoutbuilder.h>
#include <utils/qtcprocess.h>
#include <QComboBox> #include <QComboBox>
@@ -48,11 +49,10 @@ static QStringList detectedBrowsers(ProjectExplorer::Target *target)
const Utils::Environment environment = bc->environment(); const Utils::Environment environment = bc->environment();
const Utils::FilePath emrunPath = environment.searchInPath("emrun"); const Utils::FilePath emrunPath = environment.searchInPath("emrun");
QProcess browserLister; QtcProcess browserLister;
browserLister.setProcessEnvironment(environment.toProcessEnvironment()); browserLister.setEnvironment(environment);
browserLister.setProgram(emrunPath.toString()); browserLister.setCommand({emrunPath, {"--list_browsers"}});
browserLister.setArguments({"--list_browsers"}); browserLister.start();
browserLister.start(QIODevice::ReadOnly);
if (browserLister.waitForFinished()) { if (browserLister.waitForFinished()) {
const QByteArray output = browserLister.readAllStandardOutput(); const QByteArray output = browserLister.readAllStandardOutput();