forked from qt-creator/qt-creator
QmlDesigner: Add PuppetAlive command
The puppet can be dead but we don't now. Now the puppet is sending a alive signal. If the signal is not arriving anymore we restart the puppets. Task-number: QTCREATORBUG-12434 Change-Id: I90edab6a45f95950fd764adcb125068659d5354b Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
#include "changenodesourcecommand.h"
|
||||
#include "endpuppetcommand.h"
|
||||
#include "debugoutputcommand.h"
|
||||
#include "puppetalivecommand.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
@@ -81,6 +82,9 @@ NodeInstanceClientProxy::NodeInstanceClientProxy(QObject *parent)
|
||||
m_writeCommandCounter(0),
|
||||
m_synchronizeId(-1)
|
||||
{
|
||||
connect(&m_puppetAliveTimer, SIGNAL(timeout()), this, SLOT(sendPuppetAliveCommand()));
|
||||
m_puppetAliveTimer.setInterval(300);
|
||||
m_puppetAliveTimer.start();
|
||||
}
|
||||
|
||||
void NodeInstanceClientProxy::initializeSocket()
|
||||
@@ -227,6 +231,11 @@ void NodeInstanceClientProxy::debugOutput(const DebugOutputCommand &command)
|
||||
writeCommand(QVariant::fromValue(command));
|
||||
}
|
||||
|
||||
void NodeInstanceClientProxy::puppetAlive(const PuppetAliveCommand &command)
|
||||
{
|
||||
writeCommand(QVariant::fromValue(command));
|
||||
}
|
||||
|
||||
void NodeInstanceClientProxy::flush()
|
||||
{
|
||||
}
|
||||
@@ -302,6 +311,11 @@ void NodeInstanceClientProxy::readDataStream()
|
||||
}
|
||||
}
|
||||
|
||||
void NodeInstanceClientProxy::sendPuppetAliveCommand()
|
||||
{
|
||||
puppetAlive(PuppetAliveCommand());
|
||||
}
|
||||
|
||||
NodeInstanceServerInterface *NodeInstanceClientProxy::nodeInstanceServer() const
|
||||
{
|
||||
return m_nodeInstanceServer;
|
||||
|
||||
Reference in New Issue
Block a user