diff options
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/instances')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp | 27 | ||||
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h | 7 |
2 files changed, 21 insertions, 13 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp index 8a338df93d9..24dad650903 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp @@ -35,6 +35,7 @@ #include "nodeinstanceserverinterface.h" +#include "captureddatacommand.h" #include "changeauxiliarycommand.h" #include "changebindingscommand.h" #include "changefileurlcommand.h" @@ -84,12 +85,11 @@ constexpr void (QLocalSocket::*LocalSocketErrorFunction)(QLocalSocket::LocalSock #endif NodeInstanceClientProxy::NodeInstanceClientProxy(QObject *parent) - : QObject(parent), - m_inputIoDevice(nullptr), - m_outputIoDevice(nullptr), - m_nodeInstanceServer(nullptr), - m_writeCommandCounter(0), - m_synchronizeId(-1) + : QObject(parent) + , m_inputIoDevice(nullptr) + , m_outputIoDevice(nullptr) + , m_writeCommandCounter(0) + , m_synchronizeId(-1) { connect(&m_puppetAliveTimer, &QTimer::timeout, this, &NodeInstanceClientProxy::sendPuppetAliveCommand); m_puppetAliveTimer.setInterval(2000); @@ -174,7 +174,8 @@ bool compareCommands(const QVariant &command, const QVariant &controlCommand) else if (command.userType() == debugOutputCommandType) return command.value<DebugOutputCommand>() == controlCommand.value<DebugOutputCommand>(); else if (command.userType() == changeSelectionCommandType) - return command.value<ChangeSelectionCommand>() == controlCommand.value<ChangeSelectionCommand>(); + return command.value<ChangeSelectionCommand>() + == controlCommand.value<ChangeSelectionCommand>(); } return false; @@ -267,6 +268,11 @@ void NodeInstanceClientProxy::handlePuppetToCreatorCommand(const PuppetToCreator writeCommand(QVariant::fromValue(command)); } +void NodeInstanceClientProxy::capturedData(const CapturedDataCommand &command) +{ + writeCommand(QVariant::fromValue(command)); +} + void NodeInstanceClientProxy::flush() { } @@ -365,12 +371,13 @@ void NodeInstanceClientProxy::sendPuppetAliveCommand() NodeInstanceServerInterface *NodeInstanceClientProxy::nodeInstanceServer() const { - return m_nodeInstanceServer; + return m_nodeInstanceServer.get(); } -void NodeInstanceClientProxy::setNodeInstanceServer(NodeInstanceServerInterface *nodeInstanceServer) +void NodeInstanceClientProxy::setNodeInstanceServer( + std::unique_ptr<NodeInstanceServerInterface> nodeInstanceServer) { - m_nodeInstanceServer = nodeInstanceServer; + m_nodeInstanceServer = std::move(nodeInstanceServer); } void NodeInstanceClientProxy::createInstances(const CreateInstancesCommand &command) diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h index e6f4b58df49..fd681b69902 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h @@ -69,7 +69,7 @@ class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterfa Q_OBJECT public: - NodeInstanceClientProxy(QObject *parent = nullptr); + NodeInstanceClientProxy(QObject *parent); void informationChanged(const InformationChangedCommand &command) override; void valuesChanged(const ValuesChangedCommand &command) override; @@ -83,6 +83,7 @@ public: void puppetAlive(const PuppetAliveCommand &command); void selectionChanged(const ChangeSelectionCommand &command) override; void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) override; + void capturedData(const CapturedDataCommand &capturedData) override; void flush() override; void synchronizeWithClientProcess() override; @@ -94,7 +95,7 @@ protected: void writeCommand(const QVariant &command); void dispatchCommand(const QVariant &command); NodeInstanceServerInterface *nodeInstanceServer() const; - void setNodeInstanceServer(NodeInstanceServerInterface *nodeInstanceServer); + void setNodeInstanceServer(std::unique_ptr<NodeInstanceServerInterface> nodeInstanceServer); void createInstances(const CreateInstancesCommand &command); void changeFileUrl(const ChangeFileUrlCommand &command); @@ -130,7 +131,7 @@ private: QTimer m_puppetAliveTimer; QIODevice *m_inputIoDevice; QIODevice *m_outputIoDevice; - NodeInstanceServerInterface *m_nodeInstanceServer; + std::unique_ptr<NodeInstanceServerInterface> m_nodeInstanceServer; quint32 m_writeCommandCounter; int m_synchronizeId; }; |