aboutsummaryrefslogtreecommitdiffstats
path: root/src/remotereceiver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/remotereceiver.cpp')
-rw-r--r--src/remotereceiver.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/remotereceiver.cpp b/src/remotereceiver.cpp
index 7dbdb36..e871399 100644
--- a/src/remotereceiver.cpp
+++ b/src/remotereceiver.cpp
@@ -251,6 +251,7 @@ void RemoteReceiver::registerNode(LiveNodeEngine *node)
m_node = node;
connect(m_node, SIGNAL(logErrors(QList<QQmlError>)), this, SLOT(appendToLog(QList<QQmlError>)));
connect(m_node, SIGNAL(clearLog()), this, SLOT(clearLog()));
+ connect(m_node, SIGNAL(activeDocumentChanged(LiveDocument)), this, SLOT(onActiveDocumentChanged(LiveDocument)));
connect(this, SIGNAL(activateDocument(LiveDocument)), m_node, SLOT(setActiveDocument(LiveDocument)));
connect(this, SIGNAL(updateDocument(LiveDocument,QByteArray)), m_node, SLOT(updateDocument(LiveDocument,QByteArray)));
connect(this, SIGNAL(xOffsetChanged(int)), m_node, SLOT(setXOffset(int)));
@@ -306,6 +307,9 @@ void RemoteReceiver::maybeStartUpdateDocumentsOnConnect()
void RemoteReceiver::finishConnectionInitialization()
{
+ if (!m_node->activeDocument().isNull())
+ onActiveDocumentChanged(m_node->activeDocument());
+
m_logSentPosition = 0;
flushLog();
}
@@ -363,6 +367,18 @@ void RemoteReceiver::clearLog()
}
/*!
+ * Called to notify bench about active document change
+ */
+void RemoteReceiver::onActiveDocumentChanged(const LiveDocument &document)
+{
+ QByteArray bytes;
+ QDataStream out(&bytes, QIODevice::WriteOnly);
+ out << document.relativeFilePath();
+
+ m_client->send("activeDocumentChanged(QString)", bytes);
+}
+
+/*!
* \fn void RemoteReceiver::activateDocument(const LiveDocument& document)
*
* This signal is emitted when the remote active document \a document has changed