summaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger/qdeclarativedebugservice.cpp
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2010-05-27 13:01:29 (GMT)
committerThomas Zander <t.zander@nokia.com>2010-05-27 13:01:29 (GMT)
commit016b89d07478c91617ad345a0b3d7f16d0f8cd21 (patch)
treeb56f2a81e112d08cc6d629ea2e6e1e4259b56f35 /src/declarative/debugger/qdeclarativedebugservice.cpp
parent4459b4b29073bb82fe480b5eac1a4d9241068b38 (diff)
parent103e1e8ea5e8879f2bb97e008840a212b3004a51 (diff)
downloadQt-016b89d07478c91617ad345a0b3d7f16d0f8cd21.zip
Qt-016b89d07478c91617ad345a0b3d7f16d0f8cd21.tar.gz
Qt-016b89d07478c91617ad345a0b3d7f16d0f8cd21.tar.bz2
Merge commit 'origin/4.7' into symbian47
Conflicts: src/plugins/bearer/symbian/qnetworksession_impl.h
Diffstat (limited to 'src/declarative/debugger/qdeclarativedebugservice.cpp')
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp
index 34e73fd..dca2695 100644
--- a/src/declarative/debugger/qdeclarativedebugservice.cpp
+++ b/src/declarative/debugger/qdeclarativedebugservice.cpp
@@ -61,6 +61,7 @@ class QDeclarativeDebugServer : public QObject
public:
static QDeclarativeDebugServer *instance();
void listen();
+ void waitForConnection();
bool hasDebuggingClient() const;
private Q_SLOTS:
@@ -115,6 +116,12 @@ void QDeclarativeDebugServer::listen()
qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port);
}
+void QDeclarativeDebugServer::waitForConnection()
+{
+ Q_D(QDeclarativeDebugServer);
+ d->tcpServer->waitForNewConnection(-1);
+}
+
void QDeclarativeDebugServer::newConnection()
{
Q_D(QDeclarativeDebugServer);
@@ -144,6 +151,7 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
if (!envTested) {
envTested = true;
QByteArray env = qgetenv("QML_DEBUG_SERVER_PORT");
+ QByteArray block = qgetenv("QML_DEBUG_SERVER_BLOCK");
bool ok = false;
int port = env.toInt(&ok);
@@ -151,6 +159,9 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
if (ok && port > 1024) {
server = new QDeclarativeDebugServer(port);
server->listen();
+ if (!block.isEmpty()) {
+ server->waitForConnection();
+ }
}
}