From cb688629628957b6d37385f2dc75c68f0613e49f Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 14 Apr 2022 11:16:07 +0200 Subject: [PATCH] LocalPerfRecordWorker: Connect to QtcProcess::done() signal Instead of connecting to errorOccurred() and finished() signals. Change-Id: Ie90935f374f781bc60f54627fd5e5c272cd579e9 Reviewed-by: hjk Reviewed-by: --- .../perfprofiler/perfprofilerruncontrol.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp index d47af61c128..f08345e805c 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp @@ -131,17 +131,18 @@ public: } connect(m_process, &QtcProcess::started, this, &RunWorker::reportStarted); - connect(m_process, &QtcProcess::finished, this, &RunWorker::reportStopped); - connect(m_process, &QtcProcess::errorOccurred, [this](QProcess::ProcessError e) { + connect(m_process, &QtcProcess::done, this, [this] { // The terminate() below will frequently lead to QProcess::Crashed. We're not interested // in that. FailedToStart is the only actual failure. - if (e == QProcess::FailedToStart) { - QString msg = tr("Perf Process Failed to Start"); - QMessageBox::warning(Core::ICore::dialogParent(), - msg, tr("Make sure that you are running a recent Linux kernel and " - "that the \"perf\" utility is available.")); + if (m_process->error() == QProcess::FailedToStart) { + const QString msg = tr("Perf Process Failed to Start"); + QMessageBox::warning(Core::ICore::dialogParent(), msg, + tr("Make sure that you are running a recent Linux kernel and " + "that the \"perf\" utility is available.")); reportFailure(msg); + return; } + reportStopped(); }); Runnable perfRunnable = runnable();