LocalPerfRecordWorker: Connect to QtcProcess::done() signal

Instead of connecting to errorOccurred() and finished() signals.

Change-Id: Ie90935f374f781bc60f54627fd5e5c272cd579e9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-04-14 11:16:07 +02:00
parent cd2fc99e35
commit cb68862962

View File

@@ -131,17 +131,18 @@ public:
} }
connect(m_process, &QtcProcess::started, this, &RunWorker::reportStarted); connect(m_process, &QtcProcess::started, this, &RunWorker::reportStarted);
connect(m_process, &QtcProcess::finished, this, &RunWorker::reportStopped); connect(m_process, &QtcProcess::done, this, [this] {
connect(m_process, &QtcProcess::errorOccurred, [this](QProcess::ProcessError e) {
// The terminate() below will frequently lead to QProcess::Crashed. We're not interested // The terminate() below will frequently lead to QProcess::Crashed. We're not interested
// in that. FailedToStart is the only actual failure. // in that. FailedToStart is the only actual failure.
if (e == QProcess::FailedToStart) { if (m_process->error() == QProcess::FailedToStart) {
QString msg = tr("Perf Process Failed to Start"); const QString msg = tr("Perf Process Failed to Start");
QMessageBox::warning(Core::ICore::dialogParent(), QMessageBox::warning(Core::ICore::dialogParent(), msg,
msg, tr("Make sure that you are running a recent Linux kernel and " tr("Make sure that you are running a recent Linux kernel and "
"that the \"perf\" utility is available.")); "that the \"perf\" utility is available."));
reportFailure(msg); reportFailure(msg);
return;
} }
reportStopped();
}); });
Runnable perfRunnable = runnable(); Runnable perfRunnable = runnable();