diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-04-06 14:31:09 (GMT) |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-05-02 13:00:14 (GMT) |
commit | 9fa0a9319ee0f178d03f9bdc4afbabb8563b4c62 (patch) | |
tree | c45c07994f78e1d323da0b5ac776cb01ff1d06a1 /src | |
parent | 0b877b48dc990ca6bb806be668d60f6ced470de2 (diff) | |
download | Qt-9fa0a9319ee0f178d03f9bdc4afbabb8563b4c62.zip Qt-9fa0a9319ee0f178d03f9bdc4afbabb8563b4c62.tar.gz Qt-9fa0a9319ee0f178d03f9bdc4afbabb8563b4c62.tar.bz2 |
QDeclarativeDebugServer: Send hello answer before any service messages
This is necessary since some services may like to send a message back
immediately when its state changes to enabled.
Reviewed-by: Kai Koehne
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/debugger/qdeclarativedebugserver.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp index e43b90d..f76c747 100644 --- a/src/declarative/debugger/qdeclarativedebugserver.cpp +++ b/src/declarative/debugger/qdeclarativedebugserver.cpp @@ -242,6 +242,17 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) int version; in >> version >> d->clientPlugins; + // Send the hello answer immediately, since it needs to arrive before + // the plugins below start sending messages. + QByteArray helloAnswer; + { + QDataStream out(&helloAnswer, QIODevice::WriteOnly); + out << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << d->plugins.keys(); + } + d->connection->send(helloAnswer); + + d->gotHello = true; + QHash<QString, QDeclarativeDebugService*>::Iterator iter = d->plugins.begin(); for (; iter != d->plugins.end(); ++iter) { QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable; @@ -251,14 +262,6 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) iter.value()->statusChanged(newStatus); } - QByteArray helloAnswer; - { - QDataStream out(&helloAnswer, QIODevice::WriteOnly); - out << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << d->plugins.keys(); - } - d->connection->send(helloAnswer); - - d->gotHello = true; qWarning("QDeclarativeDebugServer: Connection established"); } else { |