aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-10-10 13:32:38 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-05 12:26:46 +0100
commit5375c095c3eb71c669053c4ca569a960dc76fabf (patch)
treebd3d71c52eeebdcdce22644505632e9ab45eceda /src/plugins
parentea90e7ec3449de7164a1acc91bd35847ec92d783 (diff)
QmlDebug: Provide public method for starting a debug server
With QQmlDebuggingEnabler::startTcpDebugServer you can create a debug server for debugging or profiling also without the qmljsdebugger command line argument. Change-Id: I642f73680585f9c7578762bcc0b247c736fe1338 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp17
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h4
2 files changed, 14 insertions, 7 deletions
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
index 4388fa7eb1..810f8d18e8 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -134,7 +134,7 @@ bool QTcpServerConnection::waitForMessage()
return d->protocol->waitForReadyRead(-1);
}
-void QTcpServerConnection::setPortRange(int portFrom, int portTo, bool block,
+bool QTcpServerConnection::setPortRange(int portFrom, int portTo, bool block,
const QString &hostaddress)
{
Q_D(QTcpServerConnection);
@@ -143,12 +143,16 @@ void QTcpServerConnection::setPortRange(int portFrom, int portTo, bool block,
d->block = block;
d->hostaddress = hostaddress;
- listen();
- if (block)
- d->tcpServer->waitForNewConnection(-1);
+ return listen();
}
-void QTcpServerConnection::listen()
+void QTcpServerConnection::waitForConnection()
+{
+ Q_D(QTcpServerConnection);
+ d->tcpServer->waitForNewConnection(-1);
+}
+
+bool QTcpServerConnection::listen()
{
Q_D(QTcpServerConnection);
@@ -177,6 +181,9 @@ void QTcpServerConnection::listen()
qWarning("QML Debugger: Unable to listen to port %d.", d->portFrom);
else
qWarning("QML Debugger: Unable to listen to ports %d - %d.", d->portFrom, d->portTo);
+ return false;
+ } else {
+ return true;
}
}
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
index 1b339f1239..66a9c59b26 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
@@ -53,14 +53,14 @@ public:
~QTcpServerConnection();
void setServer(QQmlDebugServer *server);
- void setPortRange(int portFrom, int portTo, bool bock, const QString &hostaddress);
+ bool setPortRange(int portFrom, int portTo, bool bock, const QString &hostaddress);
bool isConnected() const;
void send(const QList<QByteArray> &messages);
void disconnect();
bool waitForMessage();
- void listen();
+ bool listen();
void waitForConnection();
private Q_SLOTS: