aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp3
-rw-r--r--src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h3
-rw-r--r--src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro2
-rw-r--r--src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro20
-rw-r--r--src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp (renamed from src/qml/debugger/qqmldebugserver.cpp)29
-rw-r--r--src/plugins/qmltooling/qmldbg_server/qqmldebugserver.json3
-rw-r--r--src/plugins/qmltooling/qmldbg_server/qqmldebugserverfactory.h65
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro2
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp3
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h3
-rw-r--r--src/plugins/qmltooling/qmltooling.pro6
-rw-r--r--src/plugins/qmltooling/shared/qqmldebugserver.h (renamed from src/qml/debugger/qqmldebugserver_p.h)8
-rw-r--r--src/plugins/qmltooling/shared/qqmldebugserverconnection.h (renamed from src/qml/debugger/qqmldebugserverconnection_p.h)2
-rw-r--r--src/qml/debugger/debugger.pri4
-rw-r--r--src/qml/debugger/qqmldebugconnector.cpp14
-rw-r--r--src/qml/debugger/qqmldebugconnector_p.h9
16 files changed, 143 insertions, 33 deletions
diff --git a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp
index 344700b8fd..266f450720 100644
--- a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp
@@ -33,12 +33,11 @@
#include "qlocalclientconnection.h"
#include "qpacketprotocol.h"
+#include "qqmldebugserver.h"
#include <QtCore/qplugin.h>
#include <QtNetwork/qlocalsocket.h>
-#include <private/qqmldebugserver_p.h>
-
QT_BEGIN_NAMESPACE
class QLocalClientConnectionPrivate {
diff --git a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h
index 424337900b..afc86a22ef 100644
--- a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h
+++ b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.h
@@ -34,11 +34,10 @@
#ifndef QLOCALCLIENTCONNECTION_H
#define QLOCALCLIENTCONNECTION_H
-#include <private/qqmldebugserverconnection_p.h>
+#include "qqmldebugserverconnection.h"
QT_BEGIN_NAMESPACE
-class QQmlDebugServer;
class QLocalClientConnectionPrivate;
class QLocalClientConnection : public QObject, public QQmlDebugServerConnection
{
diff --git a/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro
index 3a38696c17..d8eb5ed5b6 100644
--- a/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro
+++ b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro
@@ -11,6 +11,8 @@ SOURCES += \
HEADERS += \
$$PWD/qlocalclientconnection.h \
+ $$PWD/../shared/qqmldebugserver.h \
+ $$PWD/../shared/qqmldebugserverconnection.h \
$$PWD/../shared/qpacketprotocol.h
INCLUDEPATH += $$PWD \
diff --git a/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro b/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro
new file mode 100644
index 0000000000..034f29c522
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro
@@ -0,0 +1,20 @@
+TARGET = qmldbg_server
+QT = qml-private core-private
+
+PLUGIN_TYPE = qmltooling
+PLUGIN_CLASS_NAME = QQmlDebugServerFactory
+load(qt_plugin)
+
+SOURCES += \
+ $$PWD/qqmldebugserver.cpp \
+
+HEADERS += \
+ $$PWD/qqmldebugserverfactory.h \
+ $$PWD/../shared/qqmldebugserver.h \
+ $$PWD/../shared/qqmldebugserverconnection.h
+
+INCLUDEPATH += $$PWD \
+ $$PWD/../shared
+
+OTHER_FILES += \
+ qqmldebugserver.json
diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
index a2aab9e1b6..83724f2607 100644
--- a/src/qml/debugger/qqmldebugserver.cpp
+++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
@@ -31,10 +31,11 @@
**
****************************************************************************/
-#include "qqmldebugserver_p.h"
-#include "qqmldebugserverconnection_p.h"
-#include "qqmldebugservice_p.h"
+#include "qqmldebugserver.h"
+#include "qqmldebugserverfactory.h"
+#include "qqmldebugserverconnection.h"
+#include <private/qqmldebugservice_p.h>
#include <private/qqmlengine_p.h>
#include <private/qqmlglobal_p.h>
@@ -120,7 +121,7 @@ private:
friend struct StartTcpServerAction;
friend struct ConnectToLocalAction;
friend class QQmlDebugServerThread;
- friend QQmlDebugConnector *loadQQmlDebugConnector(const QString &key);
+ friend class QQmlDebugServerFactory;
class EngineCondition {
public:
@@ -157,8 +158,6 @@ private:
QAtomicInt m_changeServiceStateCalls;
};
-Q_GLOBAL_STATIC(QQmlDebugServerImpl, debugServerInstance)
-
class QQmlDebugServerThread : public QThread
{
public:
@@ -356,17 +355,11 @@ bool QQmlDebugServerImpl::blockingMode() const
return m_blockingMode;
}
-QQmlDebugConnector *loadQQmlDebugConnector(const QString &key)
-{
- if (key == QLatin1String("QQmlDebugServer")) {
- return debugServerInstance();
- } else {
- return 0;
- }
-}
-
static void cleanupOnShutdown()
{
+ // We cannot do this in the destructor as the connection plugin will get unloaded before the
+ // server plugin and we need the connection to send any remaining data. This function is
+ // triggered before any plugins are unloaded.
QQmlDebugServerImpl::cleanup();
}
@@ -789,6 +782,12 @@ void QQmlDebugServerImpl::EngineCondition::wake()
Q_ASSERT_X(numServices >=0, Q_FUNC_INFO, "Woken more often than #services.");
}
+QQmlDebugConnector *QQmlDebugServerFactory::create(const QString &key)
+{
+ // Cannot parent it to this because it gets moved to another thread
+ return (key == QLatin1String("QQmlDebugServer") ? new QQmlDebugServerImpl : 0);
+}
+
QT_END_NAMESPACE
#include "qqmldebugserver.moc"
diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.json b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.json
new file mode 100644
index 0000000000..9b8dd3ae79
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "QQmlDebugServer" ]
+}
diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserverfactory.h b/src/plugins/qmltooling/qmldbg_server/qqmldebugserverfactory.h
new file mode 100644
index 0000000000..825a71bab8
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserverfactory.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** 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 QQMLDEBUGSERVERFACTORY_H
+#define QQMLDEBUGSERVERFACTORY_H
+
+#include <private/qqmldebugconnector_p.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// ementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+class QQmlDebugServerFactory : public QQmlDebugConnectorFactory
+{
+ Q_OBJECT
+
+ // The interface for the code that loads this thing is QQmlDebugConnector.
+ // QQmlDebugServer is for connection plugins.
+ Q_PLUGIN_METADATA(IID QQmlDebugConnectorFactory_iid FILE "qqmldebugserver.json")
+public:
+ QQmlDebugConnector *create(const QString &key);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLDEBUGSERVERFACTORY_H
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro
index 5e3660e793..cb5d1f3045 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro
+++ b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro
@@ -11,6 +11,8 @@ SOURCES += \
HEADERS += \
$$PWD/qtcpserverconnection.h \
+ $$PWD/../shared/qqmldebugserver.h \
+ $$PWD/../shared/qqmldebugserverconnection.h \
$$PWD/../shared/qpacketprotocol.h
INCLUDEPATH += $$PWD \
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
index f7c0673c19..4333a9c7e9 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -33,13 +33,12 @@
#include "qtcpserverconnection.h"
#include "qpacketprotocol.h"
+#include "qqmldebugserver.h"
#include <QtCore/qplugin.h>
#include <QtNetwork/qtcpserver.h>
#include <QtNetwork/qtcpsocket.h>
-#include <private/qqmldebugserver_p.h>
-
QT_BEGIN_NAMESPACE
class QTcpServerConnectionPrivate {
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
index 496d328a11..68271abfe6 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
@@ -34,11 +34,10 @@
#ifndef QTCPSERVERCONNECTION_H
#define QTCPSERVERCONNECTION_H
-#include <private/qqmldebugserverconnection_p.h>
+#include "qqmldebugserverconnection.h"
QT_BEGIN_NAMESPACE
-class QQmlDebugServer;
class QTcpServerConnectionPrivate;
class QTcpServerConnection : public QObject, public QQmlDebugServerConnection
{
diff --git a/src/plugins/qmltooling/qmltooling.pro b/src/plugins/qmltooling/qmltooling.pro
index 585f80138b..64069d1ad8 100644
--- a/src/plugins/qmltooling/qmltooling.pro
+++ b/src/plugins/qmltooling/qmltooling.pro
@@ -1,4 +1,8 @@
TEMPLATE = subdirs
-SUBDIRS = qmldbg_tcp qmldbg_local
+SUBDIRS += \
+ qmldbg_local \
+ qmldbg_server \
+ qmldbg_tcp
+
qtHaveModule(quick): SUBDIRS += qmldbg_qtquick2
diff --git a/src/qml/debugger/qqmldebugserver_p.h b/src/plugins/qmltooling/shared/qqmldebugserver.h
index 56dfbde416..574930aacc 100644
--- a/src/qml/debugger/qqmldebugserver_p.h
+++ b/src/plugins/qmltooling/shared/qqmldebugserver.h
@@ -31,8 +31,8 @@
**
****************************************************************************/
-#ifndef QQMLDEBUGSERVER_P_H
-#define QQMLDEBUGSERVER_P_H
+#ifndef QQMLDEBUGSERVER_H
+#define QQMLDEBUGSERVER_H
#include <private/qqmldebugconnector_p.h>
#include <private/qtqmlglobal_p.h>
@@ -50,7 +50,7 @@
QT_BEGIN_NAMESPACE
-class Q_QML_PRIVATE_EXPORT QQmlDebugServer : protected QQmlDebugConnector
+class QQmlDebugServer : protected QQmlDebugConnector
{
Q_OBJECT
public:
@@ -59,4 +59,4 @@ public:
QT_END_NAMESPACE
-#endif // QQMLDEBUGSERVER_P_H
+#endif // QQMLDEBUGSERVER_H
diff --git a/src/qml/debugger/qqmldebugserverconnection_p.h b/src/plugins/qmltooling/shared/qqmldebugserverconnection.h
index 72a4395bb3..592a1d6295 100644
--- a/src/qml/debugger/qqmldebugserverconnection_p.h
+++ b/src/plugins/qmltooling/shared/qqmldebugserverconnection.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
class QQmlDebugServer;
-class Q_QML_PRIVATE_EXPORT QQmlDebugServerConnection
+class QQmlDebugServerConnection
{
public:
QQmlDebugServerConnection() {}
diff --git a/src/qml/debugger/debugger.pri b/src/qml/debugger/debugger.pri
index 9f9e78a68a..c6231fddd5 100644
--- a/src/qml/debugger/debugger.pri
+++ b/src/qml/debugger/debugger.pri
@@ -6,7 +6,6 @@ SOURCES += \
$$PWD/qqmldebugservice.cpp \
$$PWD/qqmldebugserviceinterfaces.cpp \
$$PWD/qqmlprofilerservice.cpp \
- $$PWD/qqmldebugserver.cpp \
$$PWD/qqmlinspectorservice.cpp \
$$PWD/qqmlenginedebugservice.cpp \
$$PWD/qdebugmessageservice.cpp \
@@ -16,13 +15,12 @@ SOURCES += \
$$PWD/qv4profileradapter.cpp \
$$PWD/qqmlprofiler.cpp
+
HEADERS += \
$$PWD/qqmldebugconnector_p.h \
$$PWD/qqmldebugpluginmanager_p.h \
$$PWD/qqmldebugservice_p.h \
$$PWD/qqmlprofilerservice_p.h \
- $$PWD/qqmldebugserver_p.h \
- $$PWD/qqmldebugserverconnection_p.h \
$$PWD/qqmldebugserviceinterfaces_p.h \
$$PWD/qqmldebugstatesdelegate_p.h \
$$PWD/qqmlinspectorservice_p.h \
diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp
index b31e61749b..b14ada6a62 100644
--- a/src/qml/debugger/qqmldebugconnector.cpp
+++ b/src/qml/debugger/qqmldebugconnector.cpp
@@ -49,7 +49,9 @@
QT_BEGIN_NAMESPACE
-extern QQmlDebugConnector *loadQQmlDebugConnector(const QString &key);
+// We could add more plugins here, and distinguish by arguments to instance()
+Q_QML_DEBUG_PLUGIN_LOADER(QQmlDebugConnector)
+Q_QML_IMPORT_DEBUG_PLUGIN(QQmlDebugServerFactory)
struct QQmlDebugConnectorParams {
QString pluginKey;
@@ -125,4 +127,14 @@ QQmlDebugConnector *QQmlDebugConnector::instance()
return params->instance;
}
+QQmlDebugConnectorFactory::~QQmlDebugConnectorFactory()
+{
+ // This is triggered when the plugin is unloaded.
+ QQmlDebugConnectorParams *params = qmlDebugConnectorParams();
+ if (params && params->instance) {
+ delete params->instance;
+ params->instance = 0;
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/qml/debugger/qqmldebugconnector_p.h b/src/qml/debugger/qqmldebugconnector_p.h
index a45da4cae0..a4531bf1a9 100644
--- a/src/qml/debugger/qqmldebugconnector_p.h
+++ b/src/qml/debugger/qqmldebugconnector_p.h
@@ -83,6 +83,15 @@ protected:
static QString commandLineArguments();
};
+class Q_QML_PRIVATE_EXPORT QQmlDebugConnectorFactory : public QObject {
+ Q_OBJECT
+public:
+ virtual QQmlDebugConnector *create(const QString &key) = 0;
+ ~QQmlDebugConnectorFactory();
+};
+
+#define QQmlDebugConnectorFactory_iid "org.qt-project.Qt.QQmlDebugConnectorFactory"
+
QT_END_NAMESPACE
#endif // QQMLDEBUGCONNECTOR_H