SshProcessInterface: Give a parent to subobject

This is needed when moving ProcessInterface beweeen threads.

Change-Id: I26158c68bdc8e77ecb3e3d4535ba767ef3d0b63c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2022-05-02 14:00:42 +02:00
parent 11544df48b
commit 1a3cb067b8

View File

@@ -679,6 +679,7 @@ SshProcessInterfacePrivate::SshProcessInterfacePrivate(SshProcessInterface *sshI
LinuxDevicePrivate *devicePrivate) LinuxDevicePrivate *devicePrivate)
: QObject(sshInterface) : QObject(sshInterface)
, q(sshInterface) , q(sshInterface)
, m_process(this)
, m_devicePrivate(devicePrivate) , m_devicePrivate(devicePrivate)
, m_device(m_devicePrivate->q->sharedFromThis()) , m_device(m_devicePrivate->q->sharedFromThis())
{ {
@@ -701,6 +702,7 @@ void SshProcessInterfacePrivate::start()
if (SshSettings::connectionSharingEnabled()) { if (SshSettings::connectionSharingEnabled()) {
m_connecting = true; m_connecting = true;
m_connectionHandle.reset(new SshConnectionHandle(m_devicePrivate->q->sharedFromThis())); m_connectionHandle.reset(new SshConnectionHandle(m_devicePrivate->q->sharedFromThis()));
m_connectionHandle->setParent(this);
connect(m_connectionHandle.get(), &SshConnectionHandle::connected, connect(m_connectionHandle.get(), &SshConnectionHandle::connected,
this, &SshProcessInterfacePrivate::handleConnected); this, &SshProcessInterfacePrivate::handleConnected);
connect(m_connectionHandle.get(), &SshConnectionHandle::disconnected, connect(m_connectionHandle.get(), &SshConnectionHandle::disconnected,