summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2011-08-24 12:13:39 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-24 13:51:39 +0200
commit7991b204fd7dd4909a853531cf8eb23835bbce39 (patch)
tree7a3bcd12ff992c08c4f534e50b028f74b82d96a2
parent1253db60ee2586b1546cbaeeacb7b8c3d77ab255 (diff)
DeclarativeDebug: Clear service name when returning from waitForMessage
The service name is cleared in waitForMessage instead of receiveMessage so that consequent packets can de delivered to the service. A flag is used to check if the operation succeeded. Change-Id: I45b94a6194026d22ffb75a394628c7497ce4704e Reviewed-on: http://codereview.qt.nokia.com/3486 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp
index a69e01a6fe..e7785d0f90 100644
--- a/src/declarative/debugger/qdeclarativedebugserver.cpp
+++ b/src/declarative/debugger/qdeclarativedebugserver.cpp
@@ -91,6 +91,7 @@ public:
QStringList clientPlugins;
bool gotHello;
QString waitingForMsgFromService;
+ bool waitingForMsgSucceeded;
private:
// private slot
@@ -100,7 +101,8 @@ private:
QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() :
connection(0),
- gotHello(false)
+ gotHello(false),
+ waitingForMsgSucceeded(false)
{
}
@@ -313,7 +315,7 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message)
if (d->waitingForMsgFromService == name) {
// deliver directly so that it is delivered before waitForMessage is returning.
d->_q_deliverMessage(name, message);
- d->waitingForMsgFromService.clear();
+ d->waitingForMsgSucceeded = true;
} else {
// deliver message in next event loop run.
// Fixes the case that the service does start it's own event loop ...,
@@ -403,11 +405,13 @@ bool QDeclarativeDebugServer::waitForMessage(QDeclarativeDebugService *service)
|| !d->waitingForMsgFromService.isEmpty())
return false;
+ d->waitingForMsgSucceeded = false;
d->waitingForMsgFromService = service->name();
do {
d->connection->waitForMessage();
- } while (!d->waitingForMsgFromService.isEmpty());
+ } while (!d->waitingForMsgSucceeded);
+ d->waitingForMsgFromService.clear();
return true;
}