forked from qt-creator/qt-creator
QmlDesigner: Flush the output stream after sending commands
The output stream should be flushed in order to forward containing data and clear the stream buffer. Task-number: QDS-9871 Change-Id: Iec9903a8afb98f3b9d03a9b9c4de67b6bfe3d35b Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -79,6 +79,7 @@ NodeInstanceClientProxy::NodeInstanceClientProxy(QObject *parent)
|
|||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, m_inputIoDevice(nullptr)
|
, m_inputIoDevice(nullptr)
|
||||||
, m_outputIoDevice(nullptr)
|
, m_outputIoDevice(nullptr)
|
||||||
|
, m_localSocket(nullptr)
|
||||||
, m_writeCommandCounter(0)
|
, m_writeCommandCounter(0)
|
||||||
, m_synchronizeId(-1)
|
, m_synchronizeId(-1)
|
||||||
{
|
{
|
||||||
@@ -101,6 +102,7 @@ void NodeInstanceClientProxy::initializeSocket()
|
|||||||
|
|
||||||
m_inputIoDevice = localSocket;
|
m_inputIoDevice = localSocket;
|
||||||
m_outputIoDevice = localSocket;
|
m_outputIoDevice = localSocket;
|
||||||
|
m_localSocket = localSocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeInstanceClientProxy::initializeCapturedStream(const QString &fileName)
|
void NodeInstanceClientProxy::initializeCapturedStream(const QString &fileName)
|
||||||
@@ -288,6 +290,8 @@ void NodeInstanceClientProxy::sceneCreated(const SceneCreatedCommand &command)
|
|||||||
|
|
||||||
void NodeInstanceClientProxy::flush()
|
void NodeInstanceClientProxy::flush()
|
||||||
{
|
{
|
||||||
|
if (m_localSocket)
|
||||||
|
m_localSocket->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeInstanceClientProxy::synchronizeWithClientProcess()
|
void NodeInstanceClientProxy::synchronizeWithClientProcess()
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ private:
|
|||||||
QTimer m_puppetAliveTimer;
|
QTimer m_puppetAliveTimer;
|
||||||
QIODevice *m_inputIoDevice;
|
QIODevice *m_inputIoDevice;
|
||||||
QIODevice *m_outputIoDevice;
|
QIODevice *m_outputIoDevice;
|
||||||
|
QLocalSocket *m_localSocket;
|
||||||
std::unique_ptr<NodeInstanceServerInterface> m_nodeInstanceServer;
|
std::unique_ptr<NodeInstanceServerInterface> m_nodeInstanceServer;
|
||||||
quint32 m_writeCommandCounter;
|
quint32 m_writeCommandCounter;
|
||||||
int m_synchronizeId;
|
int m_synchronizeId;
|
||||||
|
|||||||
@@ -97,10 +97,11 @@ void Qt5BakeLightsNodeInstanceServer::bakeLights()
|
|||||||
switch (status) {
|
switch (status) {
|
||||||
case QQuick3DLightmapBaker::BakingStatus::Progress:
|
case QQuick3DLightmapBaker::BakingStatus::Progress:
|
||||||
case QQuick3DLightmapBaker::BakingStatus::Warning:
|
case QQuick3DLightmapBaker::BakingStatus::Warning:
|
||||||
case QQuick3DLightmapBaker::BakingStatus::Error:
|
case QQuick3DLightmapBaker::BakingStatus::Error: {
|
||||||
nodeInstanceClient()->handlePuppetToCreatorCommand(
|
nodeInstanceClient()->handlePuppetToCreatorCommand(
|
||||||
{PuppetToCreatorCommand::BakeLightsProgress, msg.value_or("")});
|
{PuppetToCreatorCommand::BakeLightsProgress, msg.value_or("")});
|
||||||
break;
|
nodeInstanceClient()->flush();
|
||||||
|
} break;
|
||||||
case QQuick3DLightmapBaker::BakingStatus::Cancelled:
|
case QQuick3DLightmapBaker::BakingStatus::Cancelled:
|
||||||
abort(tr("Baking cancelled."));
|
abort(tr("Baking cancelled."));
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user