Replace QtcProcess::stopProcess() by stop()

Amends 219339987aaf67fe97c5ffa418879b747545b137

Change-Id: I31709910a5f0a4f4ec5bcbafa422f693b3c2049e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-06-16 10:34:22 +02:00
parent 3ef8635261
commit b7a71af4c1
2 changed files with 8 additions and 6 deletions

View File

@@ -127,7 +127,7 @@ bool AndroidQmlPreviewWorker::isPreviewRunning(int lastKnownPid) const
void AndroidQmlPreviewWorker::startPidWatcher() void AndroidQmlPreviewWorker::startPidWatcher()
{ {
m_pidFutureWatcher.setFuture(Utils::runAsync([this]() { m_pidFutureWatcher.setFuture(runAsync([this]() {
// wait for started // wait for started
const int sleepTimeMs = 2000; const int sleepTimeMs = 2000;
QDeadlineTimer deadline(20000); QDeadlineTimer deadline(20000);
@@ -157,7 +157,7 @@ void AndroidQmlPreviewWorker::startLogcat()
QString args = QString("logcat --pid=%1").arg(m_viewerPid); QString args = QString("logcat --pid=%1").arg(m_viewerPid);
if (!m_logcatStartTimeStamp.isEmpty()) if (!m_logcatStartTimeStamp.isEmpty())
args += QString(" -T '%1'").arg(m_logcatStartTimeStamp); args += QString(" -T '%1'").arg(m_logcatStartTimeStamp);
Utils::CommandLine cmd(AndroidConfigurations::currentConfig().adbToolPath()); CommandLine cmd(AndroidConfigurations::currentConfig().adbToolPath());
cmd.setArguments(args); cmd.setArguments(args);
m_logcatProcess.setCommand(cmd); m_logcatProcess.setCommand(cmd);
m_logcatProcess.setUseCtrlCStub(true); m_logcatProcess.setUseCtrlCStub(true);
@@ -190,7 +190,7 @@ AndroidQmlPreviewWorker::AndroidQmlPreviewWorker(ProjectExplorer::RunControl *ru
connect(this, &AndroidQmlPreviewWorker::previewPidChanged, connect(this, &AndroidQmlPreviewWorker::previewPidChanged,
this, &AndroidQmlPreviewWorker::startLogcat); this, &AndroidQmlPreviewWorker::startLogcat);
connect(this, &RunWorker::stopped, &m_logcatProcess, &Utils::QtcProcess::stopProcess); connect(this, &RunWorker::stopped, &m_logcatProcess, &QtcProcess::stop);
m_logcatProcess.setStdOutCallback([this](const QString &stdOut) { m_logcatProcess.setStdOutCallback([this](const QString &stdOut) {
filterLogcatAndAppendMessage(stdOut); filterLogcatAndAppendMessage(stdOut);
}); });
@@ -314,7 +314,7 @@ bool AndroidQmlPreviewWorker::preparePreviewArtefacts()
} }
} else { } else {
const FilePaths allFiles = m_rc->project()->files(m_rc->project()->SourceFiles); const FilePaths allFiles = m_rc->project()->files(m_rc->project()->SourceFiles);
const FilePaths filesToExport = Utils::filtered(allFiles,[](const FilePath &path) { const FilePaths filesToExport = filtered(allFiles, [](const FilePath &path) {
return path.suffix() == "qmlproject"; return path.suffix() == "qmlproject";
}); });

View File

@@ -213,8 +213,10 @@ void TerminalRunner::start()
void TerminalRunner::stop() void TerminalRunner::stop()
{ {
if (m_stubProc) if (m_stubProc && m_stubProc->isRunning()) {
m_stubProc->stopProcess(); m_stubProc->stop();
m_stubProc->waitForFinished();
}
reportStopped(); reportStopped();
} }