aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2014-12-02 15:57:06 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-26 14:13:46 +0000
commitf23d4fafbff44bcb6fb1e259ca1021a4c4326084 (patch)
tree8fd6c26460d3dd9f268e64a92ad6e6ec4b375c56 /src
parent49d3cbfa171902ae2dc61bcdadfdac1305c50a2a (diff)
Add option to use a local socket for QML debugging
Using a TCP debug server comes with a number of drawbacks. It has a larger overhead than other connection types, the application has to be able to access the network and there has to be an open port we can find somehow. Change-Id: Ia7fb24006b89419988c6504797303d84c3aa1bbc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp188
-rw-r--r--src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h78
-rw-r--r--src/plugins/qmltooling/qmldbg_local/qmldbg_local.pri14
-rw-r--r--src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro8
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp7
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h1
-rw-r--r--src/plugins/qmltooling/qmltooling.pro2
-rw-r--r--src/qml/debugger/qqmldebug.h1
-rw-r--r--src/qml/debugger/qqmldebugserver.cpp128
-rw-r--r--src/qml/debugger/qqmldebugserver_p.h1
-rw-r--r--src/qml/debugger/qqmldebugserverconnection_p.h1
-rw-r--r--src/qml/qml/qqmlengine.cpp21
12 files changed, 415 insertions, 35 deletions
diff --git a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp
new file mode 100644
index 0000000000..344700b8fd
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qlocalclientconnection.h"
+#include "qpacketprotocol.h"
+
+#include <QtCore/qplugin.h>
+#include <QtNetwork/qlocalsocket.h>
+
+#include <private/qqmldebugserver_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QLocalClientConnectionPrivate {
+public:
+ QLocalClientConnectionPrivate();
+
+ bool block;
+ QString filename;
+ QLocalSocket *socket;
+ QPacketProtocol *protocol;
+ QQmlDebugServer *debugServer;
+};
+
+QLocalClientConnectionPrivate::QLocalClientConnectionPrivate() :
+ block(false),
+ socket(0),
+ protocol(0),
+ debugServer(0)
+{
+}
+
+QLocalClientConnection::QLocalClientConnection() :
+ d_ptr(new QLocalClientConnectionPrivate)
+{
+}
+
+QLocalClientConnection::~QLocalClientConnection()
+{
+ if (isConnected())
+ disconnect();
+ delete d_ptr;
+}
+
+void QLocalClientConnection::setServer(QQmlDebugServer *server)
+{
+ Q_D(QLocalClientConnection);
+ d->debugServer = server;
+}
+
+bool QLocalClientConnection::isConnected() const
+{
+ Q_D(const QLocalClientConnection);
+ return d->socket && d->socket->state() == QLocalSocket::ConnectedState;
+}
+
+void QLocalClientConnection::send(const QList<QByteArray> &messages)
+{
+ Q_D(QLocalClientConnection);
+
+ if (!isConnected() || !d->protocol || !d->socket)
+ return;
+
+ foreach (const QByteArray &message, messages) {
+ QPacket pack;
+ pack.writeRawData(message.data(), message.length());
+ d->protocol->send(pack);
+ }
+ d->socket->flush();
+}
+
+void QLocalClientConnection::disconnect()
+{
+ Q_D(QLocalClientConnection);
+
+ while (d->socket && d->socket->bytesToWrite() > 0)
+ d->socket->waitForBytesWritten();
+
+ // protocol might still be processing packages at this point
+ d->protocol->deleteLater();
+ d->protocol = 0;
+ d->socket->deleteLater();
+ d->socket = 0;
+}
+
+bool QLocalClientConnection::waitForMessage()
+{
+ Q_D(QLocalClientConnection);
+ return d->protocol->waitForReadyRead(-1);
+}
+
+bool QLocalClientConnection::setPortRange(int portFrom, int portTo, bool block,
+ const QString &hostaddress)
+{
+ Q_UNUSED(portFrom);
+ Q_UNUSED(portTo);
+ Q_UNUSED(block);
+ Q_UNUSED(hostaddress);
+ return false;
+}
+
+bool QLocalClientConnection::setFileName(const QString &filename, bool block)
+{
+ Q_D(QLocalClientConnection);
+ d->filename = filename;
+ d->block = block;
+ return connect();
+}
+
+void QLocalClientConnection::waitForConnection()
+{
+ Q_D(QLocalClientConnection);
+ d->socket->waitForConnected(-1);
+}
+
+bool QLocalClientConnection::connect()
+{
+ Q_D(QLocalClientConnection);
+
+ d->socket = new QLocalSocket;
+ d->socket->setParent(this);
+ QObject::connect(d->socket, SIGNAL(connected()), this, SLOT(connectionEstablished()));
+ d->socket->connectToServer(d->filename);
+ qDebug("QML Debugger: Connecting to socket %s...",
+ d->filename.toLatin1().constData());
+ return true;
+}
+
+void QLocalClientConnection::readyRead()
+{
+ Q_D(QLocalClientConnection);
+ if (!d->protocol)
+ return;
+
+ QPacket packet = d->protocol->read();
+
+ QByteArray content = packet.data();
+ d->debugServer->receiveMessage(content);
+}
+
+void QLocalClientConnection::connectionEstablished()
+{
+ Q_D(QLocalClientConnection);
+
+ d->protocol = new QPacketProtocol(d->socket, this);
+ QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead()));
+ QObject::connect(d->protocol, SIGNAL(invalidPacket()), this, SLOT(invalidPacket()));
+
+ if (d->block)
+ d->protocol->waitForReadyRead(-1);
+}
+
+void QLocalClientConnection::invalidPacket()
+{
+ qWarning("QML Debugger: Received a corrupted packet! Giving up ...");
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h
new file mode 100644
index 0000000000..424337900b
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QLOCALCLIENTCONNECTION_H
+#define QLOCALCLIENTCONNECTION_H
+
+#include <private/qqmldebugserverconnection_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlDebugServer;
+class QLocalClientConnectionPrivate;
+class QLocalClientConnection : public QObject, public QQmlDebugServerConnection
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QLocalClientConnection)
+ Q_DISABLE_COPY(QLocalClientConnection)
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlDebugServerConnection")
+ Q_INTERFACES(QQmlDebugServerConnection)
+
+public:
+ QLocalClientConnection();
+ ~QLocalClientConnection();
+
+ void setServer(QQmlDebugServer *server);
+ bool setPortRange(int portFrom, int portTo, bool bock, const QString &hostaddress);
+ bool setFileName(const QString &filename, bool block);
+
+ bool isConnected() const;
+ void send(const QList<QByteArray> &messages);
+ void disconnect();
+ bool waitForMessage();
+
+ void waitForConnection();
+ bool connect();
+
+private Q_SLOTS:
+ void readyRead();
+ void connectionEstablished();
+ void invalidPacket();
+
+private:
+ QLocalClientConnectionPrivate *d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QLOCALCLIENTCONNECTION_H
diff --git a/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pri b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pri
new file mode 100644
index 0000000000..7635523e9b
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pri
@@ -0,0 +1,14 @@
+QT += core-private
+
+SOURCES += \
+ $$PWD/qlocalclientconnection.cpp \
+ $$PWD/../shared/qpacketprotocol.cpp
+
+HEADERS += \
+ $$PWD/qlocalclientconnection.h \
+ $$PWD/../shared/qpacketprotocol.h
+
+INCLUDEPATH += $$PWD \
+ $$PWD/../shared
+
+OTHER_FILES += $$PWD/qlocalclientconnection.json
diff --git a/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro
new file mode 100644
index 0000000000..b060154933
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro
@@ -0,0 +1,8 @@
+TARGET = qmldbg_local
+QT = qml-private core-private
+
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QLocalClientConnection
+load(qt_plugin)
+
+include(qmldbg_local.pri)
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
index 2ae4edfce4..f7c0673c19 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -146,6 +146,13 @@ bool QTcpServerConnection::setPortRange(int portFrom, int portTo, bool block,
return listen();
}
+bool QTcpServerConnection::setFileName(const QString &fileName, bool block)
+{
+ Q_UNUSED(fileName);
+ Q_UNUSED(block);
+ return false;
+}
+
void QTcpServerConnection::waitForConnection()
{
Q_D(QTcpServerConnection);
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
index 942fb6e12c..496d328a11 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
@@ -54,6 +54,7 @@ public:
void setServer(QQmlDebugServer *server);
bool setPortRange(int portFrom, int portTo, bool bock, const QString &hostaddress);
+ bool setFileName(const QString &fileName, bool block);
bool isConnected() const;
void send(const QList<QByteArray> &messages);
diff --git a/src/plugins/qmltooling/qmltooling.pro b/src/plugins/qmltooling/qmltooling.pro
index 3bc48a6b33..585f80138b 100644
--- a/src/plugins/qmltooling/qmltooling.pro
+++ b/src/plugins/qmltooling/qmltooling.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = qmldbg_tcp
+SUBDIRS = qmldbg_tcp qmldbg_local
qtHaveModule(quick): SUBDIRS += qmldbg_qtquick2
diff --git a/src/qml/debugger/qqmldebug.h b/src/qml/debugger/qqmldebug.h
index bb90c4f1b8..421c6968b9 100644
--- a/src/qml/debugger/qqmldebug.h
+++ b/src/qml/debugger/qqmldebug.h
@@ -45,6 +45,7 @@ struct Q_QML_EXPORT QQmlDebuggingEnabler
QQmlDebuggingEnabler(bool printWarning = true);
static bool startTcpDebugServer(int port, bool block = false,
const QString &hostName = QString());
+ static bool connectToLocalDebugger(const QString &socketFileName, bool block = false);
};
// Execute code in constructor before first QQmlEngine is instantiated
diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp
index 9985efcf12..7323d3bf46 100644
--- a/src/qml/debugger/qqmldebugserver.cpp
+++ b/src/qml/debugger/qqmldebugserver.cpp
@@ -106,8 +106,11 @@ class QQmlDebugServerPrivate : public QObjectPrivate
public:
QQmlDebugServerPrivate();
- bool start(int portFrom, int portTo, bool block, const QString &hostAddress,
- const QString &pluginName);
+ bool init(const QString &pluginName, bool block);
+
+ template<class Action>
+ static bool enable(Action action);
+
void advertisePlugins();
void cleanup();
QQmlDebugServerConnection *loadConnectionPlugin(const QString &pluginName);
@@ -168,6 +171,12 @@ public:
m_hostAddress = hostAddress;
}
+ void setFileName(const QString &fileName, bool block)
+ {
+ m_fileName = fileName;
+ m_block = block;
+ }
+
void run();
private:
@@ -176,6 +185,7 @@ private:
int m_portTo;
bool m_block;
QString m_hostAddress;
+ QString m_fileName;
};
QQmlDebugServerPrivate::QQmlDebugServerPrivate() :
@@ -310,10 +320,19 @@ void QQmlDebugServerThread::run()
#endif
if (connection) {
connection->setServer(server);
- if (!connection->setPortRange(m_portFrom, m_portTo, m_block, m_hostAddress)) {
- delete connection;
- return;
+
+ if (m_fileName.isEmpty()) {
+ if (!connection->setPortRange(m_portFrom, m_portTo, m_block, m_hostAddress)) {
+ delete connection;
+ return;
+ }
+ } else {
+ if (!connection->setFileName(m_fileName, m_block)) {
+ delete connection;
+ return;
+ }
}
+
server->d_func()->connection = connection;
if (m_block)
connection->waitForConnection();
@@ -377,8 +396,7 @@ static void cleanupOnShutdown()
wrapper->cleanup();
}
-bool QQmlDebugServerPrivate::start(int portFrom, int portTo, bool block, const QString &hostAddress,
- const QString &pluginName)
+bool QQmlDebugServerPrivate::init(const QString &pluginName, bool block)
{
if (!QQmlEnginePrivate::qml_debugging_enabled)
return false;
@@ -399,9 +417,7 @@ bool QQmlDebugServerPrivate::start(int portFrom, int portTo, bool block, const Q
thread->setObjectName(QStringLiteral("QQmlDebugServerThread"));
thread->setPluginName(pluginName);
- thread->setPortRange(portFrom, portTo == -1 ? portFrom : portTo, block, hostAddress);
blockingMode = block;
- thread->start();
return true;
}
@@ -418,6 +434,7 @@ QQmlDebugServer::QQmlDebugServer()
bool block = false;
bool ok = false;
QString hostAddress;
+ QString fileName;
// format: qmljsdebugger=port:<port_from>[,port_to],host:<ip address>][,block]
if (!appD->qmljsDebugArgumentsString().isEmpty()) {
@@ -452,6 +469,10 @@ QQmlDebugServer::QQmlDebugServer()
hostAddress = strArgument.mid(5);
} else if (strArgument == QLatin1String("block")) {
block = true;
+ } else if (strArgument.startsWith(QLatin1String("file:"))) {
+ pluginName = QLatin1String("qmldbg_local");
+ fileName = strArgument.mid(5);
+ ok = !fileName.isEmpty();
} else {
qWarning() << QString::fromLatin1("QML Debugger: Invalid argument '%1' "
"detected. Ignoring the same.")
@@ -461,7 +482,13 @@ QQmlDebugServer::QQmlDebugServer()
if (ok) {
Q_D(QQmlDebugServer);
- d->start(portFrom, portTo, block, hostAddress, pluginName);
+ if (d->init(pluginName, block)) {
+ if (!fileName.isEmpty())
+ d->thread->setFileName(fileName, block);
+ else
+ d->thread->setPortRange(portFrom, portTo, block, hostAddress);
+ d->thread->start();
+ }
} else {
qWarning() << QString(QLatin1String(
"QML Debugger: Ignoring \"-qmljsdebugger=%1\". "
@@ -745,7 +772,44 @@ void QQmlDebugServer::sendMessages(QQmlDebugService *service,
Q_ARG(QList<QByteArray>, prefixedMessages));
}
-bool QQmlDebugServer::enable(int portFrom, int portTo, bool block, const QString &hostAddress)
+struct StartTcpServerAction {
+ int portFrom;
+ int portTo;
+ bool block;
+ QString hostAddress;
+
+ StartTcpServerAction(int portFrom, int portTo, bool block, const QString &hostAddress) :
+ portFrom(portFrom), portTo(portTo), block(block), hostAddress(hostAddress) {}
+
+ bool operator()(QQmlDebugServerPrivate *d)
+ {
+ if (!d->init(QLatin1String("qmldbg_tcp"), block))
+ return false;
+ d->thread->setPortRange(portFrom, portTo == -1 ? portFrom : portTo, block, hostAddress);
+ d->thread->start();
+ return true;
+ }
+};
+
+struct ConnectToLocalAction {
+ QString fileName;
+ bool block;
+
+ ConnectToLocalAction(const QString &fileName, bool block) :
+ fileName(fileName), block(block) {}
+
+ bool operator()(QQmlDebugServerPrivate *d)
+ {
+ if (!d->init(QLatin1String("qmldbg_local"), block))
+ return false;
+ d->thread->setFileName(fileName, block);
+ d->thread->start();
+ return true;
+ }
+};
+
+template<class Action>
+bool QQmlDebugServerPrivate::enable(Action action)
{
#ifndef QT_NO_QML_DEBUGGER
QQmlDebugServerInstanceWrapper *wrapper = debugServerInstance();
@@ -754,7 +818,7 @@ bool QQmlDebugServer::enable(int portFrom, int portTo, bool block, const QString
QQmlDebugServerPrivate *d = wrapper->m_instance.d_func();
if (d->thread)
return false;
- if (!d->start(portFrom, portTo, block, hostAddress, QLatin1String("qmldbg_tcp")))
+ if (!action(d))
return false;
while (!wrapper->m_instance.hasConnection()) {
if (!wrapper->m_instance.hasThread())
@@ -770,6 +834,46 @@ bool QQmlDebugServer::enable(int portFrom, int portTo, bool block, const QString
#endif
}
+/*!
+ * Enables debugging for QML engines created after calling this function. The debug server will
+ * listen on \a port at \a hostName and block the QML engine until it receives a connection if
+ * \a block is true. If \a block is not specified it won't block and if \a hostName isn't specified
+ * it will listen on all available interfaces. You can only start one debug server at a time. A
+ * debug server may have already been started if the -qmljsdebugger= command line argument was
+ * given. This method returns \c true if a new debug server was successfully started, or \c false
+ * otherwise.
+ */
+bool QQmlDebuggingEnabler::startTcpDebugServer(int port, bool block, const QString &hostName)
+{
+#ifndef QQML_NO_DEBUG_PROTOCOL
+ return QQmlDebugServerPrivate::enable(StartTcpServerAction(port, port, block, hostName));
+#else
+ Q_UNUSED(port);
+ Q_UNUSED(block);
+ Q_UNUSED(hostName);
+ return false;
+#endif
+}
+
+/*!
+ * Enables debugging for QML engines created after calling this function. The debug server will
+ * connect to a debugger waiting on a local socket at the given \a socketFileName and block the QML
+ * engine until the connection is established if \a block is true. If \a block is not specified it
+ * won't block. You can only start one debug server at a time. A debug server may have already been
+ * started if the -qmljsdebugger= command line argument was given. This method returns \c true if a
+ * new debug server was successfully started, or \c false otherwise.
+ */
+bool QQmlDebuggingEnabler::connectToLocalDebugger(const QString &socketFileName, bool block)
+{
+#ifndef QQML_NO_DEBUG_PROTOCOL
+ return QQmlDebugServerPrivate::enable(ConnectToLocalAction(socketFileName, block));
+#else
+ Q_UNUSED(fileName);
+ Q_UNUSED(block);
+ return false;
+#endif
+}
+
void QQmlDebugServer::wakeEngine(QQmlEngine *engine)
{
// to be executed in debugger thread
diff --git a/src/qml/debugger/qqmldebugserver_p.h b/src/qml/debugger/qqmldebugserver_p.h
index b2bd0b2463..f4026ca85f 100644
--- a/src/qml/debugger/qqmldebugserver_p.h
+++ b/src/qml/debugger/qqmldebugserver_p.h
@@ -79,7 +79,6 @@ public:
void receiveMessage(const QByteArray &message);
void sendMessages(QQmlDebugService *service, const QList<QByteArray> &messages);
- static bool enable(int portFrom, int portTo, bool block, const QString &hostAddress);
private slots:
void wakeEngine(QQmlEngine *engine);
diff --git a/src/qml/debugger/qqmldebugserverconnection_p.h b/src/qml/debugger/qqmldebugserverconnection_p.h
index 9170238b46..cfdf85a9b6 100644
--- a/src/qml/debugger/qqmldebugserverconnection_p.h
+++ b/src/qml/debugger/qqmldebugserverconnection_p.h
@@ -60,6 +60,7 @@ public:
virtual void setServer(QQmlDebugServer *server) = 0;
virtual bool setPortRange(int portFrom, int portTo, bool bock, const QString &hostaddress) = 0;
+ virtual bool setFileName(const QString &fileName, bool block) = 0;
virtual bool isConnected() const = 0;
virtual void send(const QList<QByteArray> &messages) = 0;
virtual void disconnect() = 0;
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index a866a33787..fdce590873 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1501,27 +1501,6 @@ QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
#endif
}
-/*!
- * Enables debugging for QML engines created after calling this function. The debug server will
- * listen on \a port at \a hostName and block the QML engine until it receives a connection if
- * \a block is true. If \a block is not specified it won't block and if \a hostName isn't specified
- * it will listen on all available interfaces. You can only start one debug server at a time. A
- * debug server may have already been started if the -qmljsdebugger= command line argument was
- * given. This method returns \c true if a new debug server was successfully started, or \c false
- * otherwise.
- */
-bool QQmlDebuggingEnabler::startTcpDebugServer(int port, bool block, const QString &hostName)
-{
-#ifndef QQML_NO_DEBUG_PROTOCOL
- return QQmlDebugServer::enable(port, port, block, hostName);
-#else
- Q_UNUSED(port);
- Q_UNUSED(block);
- Q_UNUSED(hostName);
- return false;
-#endif
-}
-
class QQmlDataExtended {
public:
QQmlDataExtended();