Implement QdbProcessInterface

It's going to replace QdbDeviceProcess.

Change-Id: I88d7dc110b71986462894f10ecb18632dcf02669
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-04-29 13:18:42 +02:00
parent 340b61889d
commit a6940abc29
2 changed files with 22 additions and 0 deletions

View File

@@ -36,6 +36,7 @@
#include <projectexplorer/runcontrol.h>
#include <remotelinux/linuxdeviceprocess.h>
#include <remotelinux/linuxprocessinterface.h>
#include <ssh/sshconnection.h>
@@ -49,6 +50,7 @@
#include <QWizard>
using namespace ProjectExplorer;
using namespace RemoteLinux;
using namespace Utils;
namespace Qdb {
@@ -74,6 +76,20 @@ public:
}
};
class QdbProcessImpl : public LinuxProcessInterface
{
public:
QdbProcessImpl(const LinuxDevice *linuxDevice)
: LinuxProcessInterface(linuxDevice) {}
~QdbProcessImpl() { killIfRunning(); }
private:
void sendControlSignal(ControlSignal controlSignal) final
{
QTC_ASSERT(controlSignal != ControlSignal::Interrupt, return);
QTC_ASSERT(controlSignal != ControlSignal::KickOff, return);
runInShell({Constants::AppcontrollerFilepath, {"--stop"}});
}
};
class DeviceApplicationObserver : public ApplicationLauncher
{
@@ -172,6 +188,11 @@ QtcProcess *QdbDevice::createProcess(QObject *parent) const
return new QdbDeviceProcess(sharedFromThis(), parent);
}
ProcessInterface *QdbDevice::createProcessInterface() const
{
return new QdbProcessImpl(this);
}
void QdbDevice::setSerialNumber(const QString &serial)
{
m_serialNumber = serial;

View File

@@ -45,6 +45,7 @@ public:
ProjectExplorer::IDeviceWidget *createWidget() final;
Utils::QtcProcess *createProcess(QObject *parent) const final;
Utils::ProcessInterface *createProcessInterface() const override;
void setSerialNumber(const QString &serial);
QString serialNumber() const;