Slog2InfoRunner: Don't use QnxDeviceProcess

Use QtcProcess with a path on qnx device instead.

Change-Id: I5dcf0f2180b40031c6f0f88b44ee2ad100ba7b5d
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-05-02 18:20:25 +02:00
parent c8024046f9
commit 2d3c3dc2b5
2 changed files with 12 additions and 12 deletions

View File

@@ -26,12 +26,12 @@
#include "slog2inforunner.h" #include "slog2inforunner.h"
#include "qnxdevice.h" #include "qnxdevice.h"
#include "qnxdeviceprocess.h"
#include "qnxrunconfiguration.h" #include "qnxrunconfiguration.h"
#include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/runconfigurationaspects.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <QRegularExpression> #include <QRegularExpression>
@@ -51,13 +51,13 @@ Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl)
// We need to limit length of ApplicationId to 63 otherwise it would not match one in slog2info. // We need to limit length of ApplicationId to 63 otherwise it would not match one in slog2info.
m_applicationId.truncate(63); m_applicationId.truncate(63);
m_testProcess = new QnxDeviceProcess(device(), this); m_testProcess = new QtcProcess(this);
connect(m_testProcess, &QtcProcess::done, this, &Slog2InfoRunner::handleTestProcessCompleted); connect(m_testProcess, &QtcProcess::done, this, &Slog2InfoRunner::handleTestProcessCompleted);
m_launchDateTimeProcess = new SshDeviceProcess(device(), this); m_launchDateTimeProcess = new QtcProcess(this);
connect(m_launchDateTimeProcess, &QtcProcess::done, this, &Slog2InfoRunner::launchSlog2Info); connect(m_launchDateTimeProcess, &QtcProcess::done, this, &Slog2InfoRunner::launchSlog2Info);
m_logProcess = new QnxDeviceProcess(device(), this); m_logProcess = new QtcProcess(this);
connect(m_logProcess, &QtcProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput); connect(m_logProcess, &QtcProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput);
connect(m_logProcess, &QtcProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError); connect(m_logProcess, &QtcProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError);
connect(m_logProcess, &QtcProcess::done, this, &Slog2InfoRunner::handleLogDone); connect(m_logProcess, &QtcProcess::done, this, &Slog2InfoRunner::handleLogDone);
@@ -70,7 +70,7 @@ void Slog2InfoRunner::printMissingWarning()
void Slog2InfoRunner::start() void Slog2InfoRunner::start()
{ {
m_testProcess->setCommand({"slog2info", {}}); m_testProcess->setCommand({device()->mapToGlobalPath("slog2info"), {}});
m_testProcess->start(); m_testProcess->start();
reportStarted(); reportStarted();
} }
@@ -107,7 +107,8 @@ void Slog2InfoRunner::handleTestProcessCompleted()
void Slog2InfoRunner::readLaunchTime() void Slog2InfoRunner::readLaunchTime()
{ {
m_launchDateTimeProcess->setCommand({"date", "+\"%d %H:%M:%S\"", CommandLine::Raw}); m_launchDateTimeProcess->setCommand({device()->mapToGlobalPath("date"),
"+\"%d %H:%M:%S\"", CommandLine::Raw});
m_launchDateTimeProcess->start(); m_launchDateTimeProcess->start();
} }
@@ -125,7 +126,7 @@ void Slog2InfoRunner::launchSlog2Info()
m_launchDateTime = QDateTime::fromString(QString::fromLatin1(m_launchDateTimeProcess->readAllStandardOutput()).trimmed(), m_launchDateTime = QDateTime::fromString(QString::fromLatin1(m_launchDateTimeProcess->readAllStandardOutput()).trimmed(),
QString::fromLatin1("dd HH:mm:ss")); QString::fromLatin1("dd HH:mm:ss"));
m_logProcess->setCommand({"slog2info", {"-w"}}); m_logProcess->setCommand({device()->mapToGlobalPath("slog2info"), {"-w"}});
m_logProcess->start(); m_logProcess->start();
} }

View File

@@ -28,13 +28,12 @@
#include <QObject> #include <QObject>
#include <projectexplorer/runcontrol.h> #include <projectexplorer/runcontrol.h>
#include <remotelinux/linuxdevice.h>
#include <utils/outputformat.h> #include <utils/outputformat.h>
#include <QDateTime> #include <QDateTime>
#include <QByteArray> #include <QByteArray>
namespace ProjectExplorer { class SshDeviceProcess; } namespace Utils { class QtcProcess; }
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
@@ -70,9 +69,9 @@ private:
bool m_currentLogs = false; bool m_currentLogs = false;
QString m_remainingData; QString m_remainingData;
ProjectExplorer::SshDeviceProcess *m_launchDateTimeProcess = nullptr; Utils::QtcProcess *m_launchDateTimeProcess = nullptr;
ProjectExplorer::SshDeviceProcess *m_testProcess = nullptr; Utils::QtcProcess *m_testProcess = nullptr;
ProjectExplorer::SshDeviceProcess *m_logProcess = nullptr; Utils::QtcProcess *m_logProcess = nullptr;
}; };
} // namespace Internal } // namespace Internal