MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / onProcessFinished

Method onProcessFinished

app/src/IO/Drivers/Process.cpp:506–526  ·  view source on GitHub ↗

* @brief Handles QProcess termination. */

Source from the content-addressed store, hash-verified

504 * @brief Handles QProcess termination.
505 */
506void IO::Drivers::Process::onProcessFinished(int exitCode, QProcess::ExitStatus status)
507{
508 if (m_process) {
509 const QByteArray remaining = m_process->readAllStandardOutput();
510 if (!remaining.isEmpty())
511 publishReceivedData(remaining);
512 }
513
514 const QString reason = (status == QProcess::CrashExit) ? tr("The process crashed.")
515 : tr("Exit code: %1").arg(exitCode);
516
517 Misc::Utilities::showMessageBox(
518 tr("Process \"%1\" stopped").arg(QFileInfo(m_executable).fileName()),
519 reason,
520 QMessageBox::Warning);
521
522 QMetaObject::invokeMethod(
523 &IO::ConnectionManager::instance(),
524 [this] { IO::ConnectionManager::instance().disconnectDevice(this); },
525 Qt::QueuedConnection);
526}
527
528/**
529 * @brief Handles a QProcess-level error during execution.

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
disconnectDeviceMethod · 0.80
fileNameMethod · 0.45

Tested by

no test coverage detected