diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-13 15:56:25 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-31 06:44:13 +0000 |
commit | cc3a57861d5ef6e84cef0adfa1aaf726dd2b9d84 (patch) | |
tree | ef5c3983cda85022afd077fe05a2cb850aa0274b /src/plugins | |
parent | 4d07a6254cac5742ffc23377b97c6eaf04aa4c49 (diff) |
Use signal/slot for passing messages through QQmlDebugServer
This results in much cleaner code than the previous implementation
using QMetaObject::invokeMethod().
We have to use read locks now for adding and removing engines, as we
should have done already before. If a condition is waiting on a write
lock you cannot acquire a read lock from another thread. So, if we kept
the write locks we wouldn't be able to receive messages while the engines
are waiting.
Change-Id: Icfe641601dec2f8d7181ae579146ed603d57a4c2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmltooling/shared/abstractviewinspector.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.cpp b/src/plugins/qmltooling/shared/abstractviewinspector.cpp index b23cff9a78..c32a297d6a 100644 --- a/src/plugins/qmltooling/shared/abstractviewinspector.cpp +++ b/src/plugins/qmltooling/shared/abstractviewinspector.cpp @@ -266,7 +266,7 @@ void AbstractViewInspector::onQmlObjectDestroyed(QObject *object) QQmlDebugStream rs(&response, QIODevice::WriteOnly); rs << QByteArray(RESPONSE) << ids.first << true << ids.second; - m_debugService->sendMessage(response); + emit m_debugService->messageToClient(m_debugService->name(), response); } void AbstractViewInspector::handleMessage(const QByteArray &message) @@ -360,7 +360,7 @@ void AbstractViewInspector::handleMessage(const QByteArray &message) QByteArray response; QQmlDebugStream rs(&response, QIODevice::WriteOnly); rs << QByteArray(RESPONSE) << requestId << success; - m_debugService->sendMessage(response); + emit m_debugService->messageToClient(m_debugService->name(), response); } void AbstractViewInspector::sendCurrentObjects(const QList<QObject*> &objects) @@ -376,7 +376,7 @@ void AbstractViewInspector::sendCurrentObjects(const QList<QObject*> &objects) debugIds << QQmlDebugService::idForObject(object); ds << debugIds; - m_debugService->sendMessage(message); + emit m_debugService->messageToClient(m_debugService->name(), message); } void AbstractViewInspector::sendQmlFileReloaded(bool success) @@ -389,7 +389,7 @@ void AbstractViewInspector::sendQmlFileReloaded(bool success) QQmlDebugStream rs(&response, QIODevice::WriteOnly); rs << QByteArray(RESPONSE) << m_reloadEventId << success; - m_debugService->sendMessage(response); + emit m_debugService->messageToClient(m_debugService->name(), response); } QString AbstractViewInspector::idStringForObject(QObject *obj) const |