From 2c0ed9491e55bdc96bc2deb5ec3c40df6e3271f6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 14 Jul 2015 14:45:50 +0200 Subject: [PATCH] Extract minimal abstract interfaces from debug services. We will access the services' functionality through those interfaces once they live in their own plugins. Change-Id: I0a0d7e73c07cb874b3b507cc4a9d304588c87bca Reviewed-by: Simon Hausmann --- .../qmltooling/shared/abstractviewinspector.cpp | 2 +- .../qmltooling/shared/abstractviewinspector.h | 4 +- src/qml/debugger/debugger.pri | 2 + src/qml/debugger/qqmlconfigurabledebugservice_p.h | 4 +- src/qml/debugger/qqmldebugconnector.cpp | 8 +- src/qml/debugger/qqmldebugserviceinterfaces.cpp | 43 +++++++ src/qml/debugger/qqmldebugserviceinterfaces_p.h | 125 +++++++++++++++++++++ src/qml/debugger/qqmlenginedebugservice.cpp | 66 ++++++----- src/qml/debugger/qqmlenginedebugservice_p.h | 17 +-- src/qml/debugger/qqmlinspectorservice.cpp | 23 ++-- src/qml/debugger/qqmlinspectorservice_p.h | 9 +- src/qml/debugger/qqmlprofilerservice.cpp | 42 +++---- src/qml/debugger/qqmlprofilerservice_p.h | 11 +- src/qml/debugger/qv4debugservice.cpp | 62 +++++----- src/qml/debugger/qv4debugservice_p.h | 15 +-- src/qml/qml/qqmlboundsignal.cpp | 2 +- src/qml/qml/qqmlcomponent.cpp | 2 +- src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 4 +- src/quick/items/qquickview.cpp | 4 +- src/quick/qtquick2.cpp | 2 +- src/quick/util/qquickprofiler.cpp | 4 +- src/quickwidgets/qquickwidget.cpp | 4 +- 22 files changed, 314 insertions(+), 141 deletions(-) create mode 100644 src/qml/debugger/qqmldebugserviceinterfaces.cpp create mode 100644 src/qml/debugger/qqmldebugserviceinterfaces_p.h diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.cpp b/src/plugins/qmltooling/shared/abstractviewinspector.cpp index 10957d2..6184b4c 100644 --- a/src/plugins/qmltooling/shared/abstractviewinspector.cpp +++ b/src/plugins/qmltooling/shared/abstractviewinspector.cpp @@ -83,7 +83,7 @@ namespace QmlJSDebugger { AbstractViewInspector::AbstractViewInspector(QObject *parent) : QObject(parent), m_enabled(false), - m_debugService(QQmlInspectorService::instance()), + m_debugService(QQmlInspectorServiceImpl::instance()), m_eventId(0), m_reloadEventId(-1) { diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.h b/src/plugins/qmltooling/shared/abstractviewinspector.h index 8958e94..342e635 100644 --- a/src/plugins/qmltooling/shared/abstractviewinspector.h +++ b/src/plugins/qmltooling/shared/abstractviewinspector.h @@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE class QQmlEngine; -class QQmlInspectorService; +class QQmlDebugService; class QKeyEvent; class QMouseEvent; class QWheelEvent; @@ -111,7 +111,7 @@ private: bool m_enabled; - QQmlInspectorService *m_debugService; + QQmlDebugService *m_debugService; QList m_tools; int m_eventId; int m_reloadEventId; diff --git a/src/qml/debugger/debugger.pri b/src/qml/debugger/debugger.pri index ec2e52e..9f9e78a 100644 --- a/src/qml/debugger/debugger.pri +++ b/src/qml/debugger/debugger.pri @@ -4,6 +4,7 @@ SOURCES += \ $$PWD/qqmldebug.cpp \ $$PWD/qqmldebugconnector.cpp \ $$PWD/qqmldebugservice.cpp \ + $$PWD/qqmldebugserviceinterfaces.cpp \ $$PWD/qqmlprofilerservice.cpp \ $$PWD/qqmldebugserver.cpp \ $$PWD/qqmlinspectorservice.cpp \ @@ -22,6 +23,7 @@ HEADERS += \ $$PWD/qqmlprofilerservice_p.h \ $$PWD/qqmldebugserver_p.h \ $$PWD/qqmldebugserverconnection_p.h \ + $$PWD/qqmldebugserviceinterfaces_p.h \ $$PWD/qqmldebugstatesdelegate_p.h \ $$PWD/qqmlinspectorservice_p.h \ $$PWD/qqmlinspectorinterface_p.h \ diff --git a/src/qml/debugger/qqmlconfigurabledebugservice_p.h b/src/qml/debugger/qqmlconfigurabledebugservice_p.h index 1329591..ce7609f 100644 --- a/src/qml/debugger/qqmlconfigurabledebugservice_p.h +++ b/src/qml/debugger/qqmlconfigurabledebugservice_p.h @@ -56,8 +56,8 @@ template class QQmlConfigurableDebugService : public Base { protected: - QQmlConfigurableDebugService(const QString &name, float version, QObject *parent = 0) : - Base(name, version, parent), m_configMutex(QMutex::Recursive) + QQmlConfigurableDebugService(float version, QObject *parent = 0) : + Base(version, parent), m_configMutex(QMutex::Recursive) { init(); } diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp index eb111f7..3157c09 100644 --- a/src/qml/debugger/qqmldebugconnector.cpp +++ b/src/qml/debugger/qqmldebugconnector.cpp @@ -105,12 +105,12 @@ QQmlDebugConnector *QQmlDebugConnector::instance() } params->instance = loadQQmlDebugConnector(QLatin1String("QQmlDebugServer")); if (params->instance) { - QQmlEngineDebugService::instance(); - QV4DebugService::instance(); - QQmlProfilerService::instance(); + QQmlEngineDebugServiceImpl::instance(); + QV4DebugServiceImpl::instance(); + QQmlProfilerServiceImpl::instance(); QDebugMessageService::instance(); QQmlEngineControlService::instance(); - QQmlInspectorService::instance(); + QQmlInspectorServiceImpl::instance(); } } diff --git a/src/qml/debugger/qqmldebugserviceinterfaces.cpp b/src/qml/debugger/qqmldebugserviceinterfaces.cpp new file mode 100644 index 0000000..2bf9f27 --- /dev/null +++ b/src/qml/debugger/qqmldebugserviceinterfaces.cpp @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** 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 "qqmldebugserviceinterfaces_p.h" + +QT_BEGIN_NAMESPACE + +const QString QV4DebugService::s_key = QStringLiteral("V8Debugger"); +const QString QQmlEngineDebugService::s_key = QStringLiteral("QmlDebugger"); +const QString QQmlInspectorService::s_key = QStringLiteral("QmlInspector"); +const QString QQmlProfilerService::s_key = QStringLiteral("CanvasFrameRate"); + +QT_END_NAMESPACE diff --git a/src/qml/debugger/qqmldebugserviceinterfaces_p.h b/src/qml/debugger/qqmldebugserviceinterfaces_p.h new file mode 100644 index 0000000..3c204bc --- /dev/null +++ b/src/qml/debugger/qqmldebugserviceinterfaces_p.h @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** 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 QQMLDEBUGSERVICEINTERFACES_P_H +#define QQMLDEBUGSERVICEINTERFACES_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class Q_QML_PRIVATE_EXPORT QV4DebugService : protected QQmlDebugService +{ + Q_OBJECT +public: + virtual void signalEmitted(const QString &signal) = 0; + +protected: + QV4DebugService(float version, QObject *parent = 0) : + QQmlDebugService(s_key, version, parent) {} + + static const QString s_key; +}; + +class Q_QML_PRIVATE_EXPORT QQmlProfilerService : protected QQmlDebugService +{ + Q_OBJECT +public: + virtual void addGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) = 0; + virtual void removeGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) = 0; + + virtual void startProfiling(QQmlEngine *engine, + quint64 features = std::numeric_limits::max()) = 0; + virtual void stopProfiling(QQmlEngine *engine) = 0; + + virtual void dataReady(QQmlAbstractProfilerAdapter *profiler) = 0; + +protected: + QQmlProfilerService(float version, QObject *parent = 0) : + QQmlDebugService(s_key, version, parent) {} + + static const QString s_key; +}; + +class Q_QML_PRIVATE_EXPORT QQmlEngineDebugService : protected QQmlDebugService +{ + Q_OBJECT +public: + virtual void objectCreated(QQmlEngine *engine, QObject *object) = 0; + virtual void setStatesDelegate(QQmlDebugStatesDelegate *) = 0; + +protected: + QQmlEngineDebugService(float version, QObject *parent = 0) : + QQmlDebugService(s_key, version, parent) {} + + QQmlBoundSignal *nextSignal(QQmlBoundSignal *prev) { return prev->m_nextSignal; } + + static const QString s_key; +}; + +class Q_QML_PRIVATE_EXPORT QQmlInspectorService : protected QQmlDebugService +{ + Q_OBJECT +public: + virtual void addView(QObject *) = 0; + virtual void removeView(QObject *) = 0; + +protected: + QQmlInspectorService(float version, QObject *parent = 0) : + QQmlDebugService(s_key, version, parent) {} + + static const QString s_key; +}; + +QT_END_NAMESPACE + +#endif // QQMLDEBUGSERVICEINTERFACES_P_H + diff --git a/src/qml/debugger/qqmlenginedebugservice.cpp b/src/qml/debugger/qqmlenginedebugservice.cpp index 1d481d9..30d2f32 100644 --- a/src/qml/debugger/qqmlenginedebugservice.cpp +++ b/src/qml/debugger/qqmlenginedebugservice.cpp @@ -53,29 +53,27 @@ QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QQmlEngineDebugService, qmlEngineDebugService) +Q_GLOBAL_STATIC(QQmlEngineDebugServiceImpl, qmlEngineDebugService) -QQmlEngineDebugService *QQmlEngineDebugService::instance() +QQmlEngineDebugServiceImpl *QQmlEngineDebugServiceImpl::instance() { return qmlEngineDebugService(); } -QQmlEngineDebugService::QQmlEngineDebugService(QObject *parent) - : QQmlDebugService(QStringLiteral("QmlDebugger"), 2, parent), - m_watch(new QQmlWatcher(this)), - m_statesDelegate(0) +QQmlEngineDebugServiceImpl::QQmlEngineDebugServiceImpl(QObject *parent) : + QQmlEngineDebugService(2, parent), m_watch(new QQmlWatcher(this)), m_statesDelegate(0) { QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)), this, SLOT(propertyChanged(int,int,QMetaProperty,QVariant))); } -QQmlEngineDebugService::~QQmlEngineDebugService() +QQmlEngineDebugServiceImpl::~QQmlEngineDebugServiceImpl() { delete m_statesDelegate; } QDataStream &operator<<(QDataStream &ds, - const QQmlEngineDebugService::QQmlObjectData &data) + const QQmlEngineDebugServiceImpl::QQmlObjectData &data) { ds << data.url << data.lineNumber << data.columnNumber << data.idString << data.objectName << data.objectType << data.objectId << data.contextId @@ -84,7 +82,7 @@ QDataStream &operator<<(QDataStream &ds, } QDataStream &operator>>(QDataStream &ds, - QQmlEngineDebugService::QQmlObjectData &data) + QQmlEngineDebugServiceImpl::QQmlObjectData &data) { ds >> data.url >> data.lineNumber >> data.columnNumber >> data.idString >> data.objectName >> data.objectType >> data.objectId >> data.contextId @@ -93,7 +91,7 @@ QDataStream &operator>>(QDataStream &ds, } QDataStream &operator<<(QDataStream &ds, - const QQmlEngineDebugService::QQmlObjectProperty &data) + const QQmlEngineDebugServiceImpl::QQmlObjectProperty &data) { ds << (int)data.type << data.name; // check first whether the data can be saved @@ -109,12 +107,12 @@ QDataStream &operator<<(QDataStream &ds, } QDataStream &operator>>(QDataStream &ds, - QQmlEngineDebugService::QQmlObjectProperty &data) + QQmlEngineDebugServiceImpl::QQmlObjectProperty &data) { int type; ds >> type >> data.name >> data.value >> data.valueTypeName >> data.binding >> data.hasNotifySignal; - data.type = (QQmlEngineDebugService::QQmlObjectProperty::Type)type; + data.type = (QQmlEngineDebugServiceImpl::QQmlObjectProperty::Type)type; return ds; } @@ -141,8 +139,8 @@ static bool hasValidSignal(QObject *object, const QString &propertyName) return true; } -QQmlEngineDebugService::QQmlObjectProperty -QQmlEngineDebugService::propertyData(QObject *obj, int propIdx) +QQmlEngineDebugServiceImpl::QQmlObjectProperty +QQmlEngineDebugServiceImpl::propertyData(QObject *obj, int propIdx) { QQmlObjectProperty rv; @@ -176,7 +174,7 @@ QQmlEngineDebugService::propertyData(QObject *obj, int propIdx) return rv; } -QVariant QQmlEngineDebugService::valueContents(QVariant value) const +QVariant QQmlEngineDebugServiceImpl::valueContents(QVariant value) const { // We can't send JS objects across the wire, so transform them to variant // maps for serialization. @@ -237,7 +235,7 @@ QVariant QQmlEngineDebugService::valueContents(QVariant value) const return QString(QStringLiteral("")); } -void QQmlEngineDebugService::buildObjectDump(QDataStream &message, +void QQmlEngineDebugServiceImpl::buildObjectDump(QDataStream &message, QObject *object, bool recur, bool dumpProperties) { message << objectData(object); @@ -297,7 +295,7 @@ void QQmlEngineDebugService::buildObjectDump(QDataStream &message, } fakeProperties << prop; - signalHandler = signalHandler->m_nextSignal; + signalHandler = nextSignal(signalHandler); } } @@ -310,7 +308,7 @@ void QQmlEngineDebugService::buildObjectDump(QDataStream &message, message << fakeProperties[ii]; } -void QQmlEngineDebugService::prepareDeferredObjects(QObject *obj) +void QQmlEngineDebugServiceImpl::prepareDeferredObjects(QObject *obj) { qmlExecuteDeferred(obj); @@ -322,7 +320,7 @@ void QQmlEngineDebugService::prepareDeferredObjects(QObject *obj) } -void QQmlEngineDebugService::storeObjectIds(QObject *co) +void QQmlEngineDebugServiceImpl::storeObjectIds(QObject *co) { QQmlDebugService::idForObject(co); QObjectList children = co->children(); @@ -330,7 +328,7 @@ void QQmlEngineDebugService::storeObjectIds(QObject *co) storeObjectIds(children.at(ii)); } -void QQmlEngineDebugService::buildObjectList(QDataStream &message, +void QQmlEngineDebugServiceImpl::buildObjectList(QDataStream &message, QQmlContext *ctxt, const QList > &instances) { @@ -374,15 +372,15 @@ void QQmlEngineDebugService::buildObjectList(QDataStream &message, } } -void QQmlEngineDebugService::buildStatesList(bool cleanList, +void QQmlEngineDebugServiceImpl::buildStatesList(bool cleanList, const QList > &instances) { if (m_statesDelegate) m_statesDelegate->buildStatesList(cleanList, instances); } -QQmlEngineDebugService::QQmlObjectData -QQmlEngineDebugService::objectData(QObject *object) +QQmlEngineDebugServiceImpl::QQmlObjectData +QQmlEngineDebugServiceImpl::objectData(QObject *object) { QQmlData *ddata = QQmlData::get(object); QQmlObjectData rv; @@ -421,7 +419,7 @@ QQmlEngineDebugService::objectData(QObject *object) return rv; } -void QQmlEngineDebugService::messageReceived(const QByteArray &message) +void QQmlEngineDebugServiceImpl::messageReceived(const QByteArray &message) { QMetaObject::invokeMethod(this, "processMessage", Qt::QueuedConnection, Q_ARG(QByteArray, message)); } @@ -429,7 +427,7 @@ void QQmlEngineDebugService::messageReceived(const QByteArray &message) /*! Returns a list of objects matching the given filename, line and column. */ -QList QQmlEngineDebugService::objectForLocationInfo(const QString &filename, +QList QQmlEngineDebugServiceImpl::objectForLocationInfo(const QString &filename, int lineNumber, int columnNumber) { QList objects; @@ -447,7 +445,7 @@ QList QQmlEngineDebugService::objectForLocationInfo(const QString &fil return objects; } -void QQmlEngineDebugService::processMessage(const QByteArray &message) +void QQmlEngineDebugServiceImpl::processMessage(const QByteArray &message) { QQmlDebugStream ds(message); @@ -629,7 +627,7 @@ void QQmlEngineDebugService::processMessage(const QByteArray &message) emit messageToClient(name(), reply); } -bool QQmlEngineDebugService::setBinding(int objectId, +bool QQmlEngineDebugServiceImpl::setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue, @@ -681,7 +679,7 @@ bool QQmlEngineDebugService::setBinding(int objectId, return ok; } -bool QQmlEngineDebugService::resetBinding(int objectId, const QString &propertyName) +bool QQmlEngineDebugServiceImpl::resetBinding(int objectId, const QString &propertyName) { QObject *object = objectForId(objectId); QQmlContext *context = qmlContext(object); @@ -734,7 +732,7 @@ bool QQmlEngineDebugService::resetBinding(int objectId, const QString &propertyN return false; } -bool QQmlEngineDebugService::setMethodBody(int objectId, const QString &method, const QString &body) +bool QQmlEngineDebugServiceImpl::setMethodBody(int objectId, const QString &method, const QString &body) { QObject *object = objectForId(objectId); QQmlContext *context = qmlContext(object); @@ -776,7 +774,7 @@ bool QQmlEngineDebugService::setMethodBody(int objectId, const QString &method, return true; } -void QQmlEngineDebugService::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) +void QQmlEngineDebugServiceImpl::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) { QByteArray reply; QQmlDebugStream rs(&reply, QIODevice::WriteOnly); @@ -786,7 +784,7 @@ void QQmlEngineDebugService::propertyChanged(int id, int objectId, const QMetaPr emit messageToClient(name(), reply); } -void QQmlEngineDebugService::engineAboutToBeAdded(QQmlEngine *engine) +void QQmlEngineDebugServiceImpl::engineAboutToBeAdded(QQmlEngine *engine) { Q_ASSERT(engine); Q_ASSERT(!m_engines.contains(engine)); @@ -795,7 +793,7 @@ void QQmlEngineDebugService::engineAboutToBeAdded(QQmlEngine *engine) emit attachedToEngine(engine); } -void QQmlEngineDebugService::engineAboutToBeRemoved(QQmlEngine *engine) +void QQmlEngineDebugServiceImpl::engineAboutToBeRemoved(QQmlEngine *engine) { Q_ASSERT(engine); Q_ASSERT(m_engines.contains(engine)); @@ -804,7 +802,7 @@ void QQmlEngineDebugService::engineAboutToBeRemoved(QQmlEngine *engine) emit detachedFromEngine(engine); } -void QQmlEngineDebugService::objectCreated(QQmlEngine *engine, QObject *object) +void QQmlEngineDebugServiceImpl::objectCreated(QQmlEngine *engine, QObject *object) { Q_ASSERT(engine); Q_ASSERT(m_engines.contains(engine)); @@ -821,7 +819,7 @@ void QQmlEngineDebugService::objectCreated(QQmlEngine *engine, QObject *object) emit messageToClient(name(), reply); } -void QQmlEngineDebugService::setStatesDelegate(QQmlDebugStatesDelegate *delegate) +void QQmlEngineDebugServiceImpl::setStatesDelegate(QQmlDebugStatesDelegate *delegate) { m_statesDelegate = delegate; } diff --git a/src/qml/debugger/qqmlenginedebugservice_p.h b/src/qml/debugger/qqmlenginedebugservice_p.h index a87d352..99a98e1 100644 --- a/src/qml/debugger/qqmlenginedebugservice_p.h +++ b/src/qml/debugger/qqmlenginedebugservice_p.h @@ -46,6 +46,7 @@ // #include +#include #include #include @@ -59,12 +60,12 @@ class QQmlWatcher; class QDataStream; class QQmlDebugStatesDelegate; -class Q_QML_PRIVATE_EXPORT QQmlEngineDebugService : public QQmlDebugService +class Q_QML_PRIVATE_EXPORT QQmlEngineDebugServiceImpl : public QQmlEngineDebugService { Q_OBJECT public: - QQmlEngineDebugService(QObject * = 0); - ~QQmlEngineDebugService(); + QQmlEngineDebugServiceImpl(QObject * = 0); + ~QQmlEngineDebugServiceImpl(); struct QQmlObjectData { QUrl url; @@ -94,7 +95,7 @@ public: void setStatesDelegate(QQmlDebugStatesDelegate *); - static QQmlEngineDebugService *instance(); + static QQmlEngineDebugServiceImpl *instance(); protected: virtual void messageReceived(const QByteArray &); @@ -123,10 +124,10 @@ private: QQmlWatcher *m_watch; QQmlDebugStatesDelegate *m_statesDelegate; }; -Q_QML_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QQmlEngineDebugService::QQmlObjectData &); -Q_QML_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QQmlEngineDebugService::QQmlObjectData &); -Q_QML_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QQmlEngineDebugService::QQmlObjectProperty &); -Q_QML_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QQmlEngineDebugService::QQmlObjectProperty &); +Q_QML_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QQmlEngineDebugServiceImpl::QQmlObjectData &); +Q_QML_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectData &); +Q_QML_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QQmlEngineDebugServiceImpl::QQmlObjectProperty &); +Q_QML_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectProperty &); QT_END_NAMESPACE diff --git a/src/qml/debugger/qqmlinspectorservice.cpp b/src/qml/debugger/qqmlinspectorservice.cpp index c6ee8e4..f3ff13a 100644 --- a/src/qml/debugger/qqmlinspectorservice.cpp +++ b/src/qml/debugger/qqmlinspectorservice.cpp @@ -48,37 +48,36 @@ DEFINE_BOOL_CONFIG_OPTION(qmlDebugVerbose, QML_DEBUGGER_VERBOSE) QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QQmlInspectorService, serviceInstance) +Q_GLOBAL_STATIC(QQmlInspectorServiceImpl, serviceInstance) -QQmlInspectorService::QQmlInspectorService() - : QQmlDebugService(QStringLiteral("QmlInspector"), 1) - , m_currentInspectorPlugin(0) +QQmlInspectorServiceImpl::QQmlInspectorServiceImpl(): QQmlInspectorService(1), + m_currentInspectorPlugin(0) { } -QQmlInspectorService *QQmlInspectorService::instance() +QQmlInspectorServiceImpl *QQmlInspectorServiceImpl::instance() { return serviceInstance(); } -void QQmlInspectorService::addView(QObject *view) +void QQmlInspectorServiceImpl::addView(QObject *view) { m_views.append(view); updateState(); } -void QQmlInspectorService::removeView(QObject *view) +void QQmlInspectorServiceImpl::removeView(QObject *view) { m_views.removeAll(view); updateState(); } -void QQmlInspectorService::stateChanged(State /*state*/) +void QQmlInspectorServiceImpl::stateChanged(State /*state*/) { QMetaObject::invokeMethod(this, "updateState", Qt::QueuedConnection); } -void QQmlInspectorService::updateState() +void QQmlInspectorServiceImpl::updateState() { if (m_views.isEmpty()) { if (m_currentInspectorPlugin) { @@ -118,18 +117,18 @@ void QQmlInspectorService::updateState() } } -void QQmlInspectorService::messageReceived(const QByteArray &message) +void QQmlInspectorServiceImpl::messageReceived(const QByteArray &message) { QMetaObject::invokeMethod(this, "processMessage", Qt::QueuedConnection, Q_ARG(QByteArray, message)); } -void QQmlInspectorService::processMessage(const QByteArray &message) +void QQmlInspectorServiceImpl::processMessage(const QByteArray &message) { if (m_currentInspectorPlugin) m_currentInspectorPlugin->clientMessage(message); } -void QQmlInspectorService::loadInspectorPlugins() +void QQmlInspectorServiceImpl::loadInspectorPlugins() { #ifndef QT_NO_LIBRARY QStringList pluginCandidates; diff --git a/src/qml/debugger/qqmlinspectorservice_p.h b/src/qml/debugger/qqmlinspectorservice_p.h index e695757..61a350c 100644 --- a/src/qml/debugger/qqmlinspectorservice_p.h +++ b/src/qml/debugger/qqmlinspectorservice_p.h @@ -46,22 +46,24 @@ // #include "qqmldebugservice_p.h" +#include "qqmldebugserviceinterfaces_p.h" #include #include QT_BEGIN_NAMESPACE +namespace QmlJSDebugger { class AbstractViewInspector; } class QQmlInspectorInterface; -class Q_QML_PRIVATE_EXPORT QQmlInspectorService : public QQmlDebugService +class Q_QML_PRIVATE_EXPORT QQmlInspectorServiceImpl : public QQmlInspectorService { Q_OBJECT public: - QQmlInspectorService(); - static QQmlInspectorService *instance(); + QQmlInspectorServiceImpl(); + static QQmlInspectorServiceImpl *instance(); void addView(QObject *); void removeView(QObject *); @@ -75,6 +77,7 @@ private Q_SLOTS: void updateState(); private: + friend class QmlJSDebugger::AbstractViewInspector; void loadInspectorPlugins(); QList m_views; diff --git a/src/qml/debugger/qqmlprofilerservice.cpp b/src/qml/debugger/qqmlprofilerservice.cpp index 2b26cdc..a858dcf 100644 --- a/src/qml/debugger/qqmlprofilerservice.cpp +++ b/src/qml/debugger/qqmlprofilerservice.cpp @@ -45,16 +45,16 @@ QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QQmlProfilerService, profilerInstance) +Q_GLOBAL_STATIC(QQmlProfilerServiceImpl, profilerInstance) -QQmlProfilerService::QQmlProfilerService() - : QQmlConfigurableDebugService(QStringLiteral("CanvasFrameRate"), 1), +QQmlProfilerServiceImpl::QQmlProfilerServiceImpl() + : QQmlConfigurableDebugService(1), m_waitingForStop(false) { m_timer.start(); } -QQmlProfilerService::~QQmlProfilerService() +QQmlProfilerServiceImpl::~QQmlProfilerServiceImpl() { // No need to lock here. If any engine or global profiler is still trying to register at this // point we have a nasty bug anyway. @@ -62,7 +62,7 @@ QQmlProfilerService::~QQmlProfilerService() qDeleteAll(m_globalProfilers); } -void QQmlProfilerService::dataReady(QQmlAbstractProfilerAdapter *profiler) +void QQmlProfilerServiceImpl::dataReady(QQmlAbstractProfilerAdapter *profiler) { QMutexLocker lock(&m_configMutex); bool dataComplete = true; @@ -94,13 +94,13 @@ void QQmlProfilerService::dataReady(QQmlAbstractProfilerAdapter *profiler) } } -QQmlProfilerService *QQmlProfilerService::instance() +QQmlProfilerServiceImpl *QQmlProfilerServiceImpl::instance() { // just make sure that the service is properly registered return profilerInstance(); } -void QQmlProfilerService::engineAboutToBeAdded(QQmlEngine *engine) +void QQmlProfilerServiceImpl::engineAboutToBeAdded(QQmlEngine *engine) { Q_ASSERT_X(QThread::currentThread() == engine->thread(), Q_FUNC_INFO, "QML profilers have to be added from the engine thread"); @@ -110,10 +110,10 @@ void QQmlProfilerService::engineAboutToBeAdded(QQmlEngine *engine) QV4ProfilerAdapter *v4Adapter = new QV4ProfilerAdapter(this, QV8Engine::getV4(engine->handle())); addEngineProfiler(qmlAdapter, engine); addEngineProfiler(v4Adapter, engine); - QQmlConfigurableDebugService::engineAboutToBeAdded(engine); + QQmlConfigurableDebugService::engineAboutToBeAdded(engine); } -void QQmlProfilerService::engineAdded(QQmlEngine *engine) +void QQmlProfilerServiceImpl::engineAdded(QQmlEngine *engine) { Q_ASSERT_X(QThread::currentThread() == engine->thread(), Q_FUNC_INFO, "QML profilers have to be added from the engine thread"); @@ -123,7 +123,7 @@ void QQmlProfilerService::engineAdded(QQmlEngine *engine) profiler->stopWaiting(); } -void QQmlProfilerService::engineAboutToBeRemoved(QQmlEngine *engine) +void QQmlProfilerServiceImpl::engineAboutToBeRemoved(QQmlEngine *engine) { Q_ASSERT_X(QThread::currentThread() == engine->thread(), Q_FUNC_INFO, "QML profilers have to be removed from the engine thread"); @@ -143,7 +143,7 @@ void QQmlProfilerService::engineAboutToBeRemoved(QQmlEngine *engine) } } -void QQmlProfilerService::engineRemoved(QQmlEngine *engine) +void QQmlProfilerServiceImpl::engineRemoved(QQmlEngine *engine) { Q_ASSERT_X(QThread::currentThread() == engine->thread(), Q_FUNC_INFO, "QML profilers have to be removed from the engine thread"); @@ -156,14 +156,14 @@ void QQmlProfilerService::engineRemoved(QQmlEngine *engine) m_engineProfilers.remove(engine); } -void QQmlProfilerService::addEngineProfiler(QQmlAbstractProfilerAdapter *profiler, QQmlEngine *engine) +void QQmlProfilerServiceImpl::addEngineProfiler(QQmlAbstractProfilerAdapter *profiler, QQmlEngine *engine) { profiler->moveToThread(thread()); profiler->synchronize(m_timer); m_engineProfilers.insert(engine, profiler); } -void QQmlProfilerService::addGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) +void QQmlProfilerServiceImpl::addGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) { QMutexLocker lock(&m_configMutex); profiler->synchronize(m_timer); @@ -179,7 +179,7 @@ void QQmlProfilerService::addGlobalProfiler(QQmlAbstractProfilerAdapter *profile profiler->startProfiling(features); } -void QQmlProfilerService::removeGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) +void QQmlProfilerServiceImpl::removeGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) { QMutexLocker lock(&m_configMutex); removeProfilerFromStartTimes(profiler); @@ -187,7 +187,7 @@ void QQmlProfilerService::removeGlobalProfiler(QQmlAbstractProfilerAdapter *prof delete profiler; } -void QQmlProfilerService::removeProfilerFromStartTimes(const QQmlAbstractProfilerAdapter *profiler) +void QQmlProfilerServiceImpl::removeProfilerFromStartTimes(const QQmlAbstractProfilerAdapter *profiler) { for (QMultiMap::iterator i(m_startTimes.begin()); i != m_startTimes.end();) { @@ -206,7 +206,7 @@ void QQmlProfilerService::removeProfilerFromStartTimes(const QQmlAbstractProfile * * If any engine profiler is started like that also start all global profilers. */ -void QQmlProfilerService::startProfiling(QQmlEngine *engine, quint64 features) +void QQmlProfilerServiceImpl::startProfiling(QQmlEngine *engine, quint64 features) { QMutexLocker lock(&m_configMutex); @@ -257,7 +257,7 @@ void QQmlProfilerService::startProfiling(QQmlEngine *engine, quint64 features) * If afterwards no more engine profilers are running, also stop all global profilers. Otherwise * only make them report their data. */ -void QQmlProfilerService::stopProfiling(QQmlEngine *engine) +void QQmlProfilerServiceImpl::stopProfiling(QQmlEngine *engine) { QMutexLocker lock(&m_configMutex); QList stopping; @@ -303,7 +303,7 @@ void QQmlProfilerService::stopProfiling(QQmlEngine *engine) /* Send the queued up messages. */ -void QQmlProfilerService::sendMessages() +void QQmlProfilerServiceImpl::sendMessages() { QList messages; @@ -359,7 +359,7 @@ void QQmlProfilerService::sendMessages() } } -void QQmlProfilerService::stateAboutToBeChanged(QQmlDebugService::State newState) +void QQmlProfilerServiceImpl::stateAboutToBeChanged(QQmlDebugService::State newState) { QMutexLocker lock(&m_configMutex); @@ -373,7 +373,7 @@ void QQmlProfilerService::stateAboutToBeChanged(QQmlDebugService::State newState } } -void QQmlProfilerService::messageReceived(const QByteArray &message) +void QQmlProfilerServiceImpl::messageReceived(const QByteArray &message) { QMutexLocker lock(&m_configMutex); @@ -412,7 +412,7 @@ void QQmlProfilerService::messageReceived(const QByteArray &message) stopWaiting(); } -void QQmlProfilerService::flush() +void QQmlProfilerServiceImpl::flush() { QMutexLocker lock(&m_configMutex); diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h index d593c43..ea73216 100644 --- a/src/qml/debugger/qqmlprofilerservice_p.h +++ b/src/qml/debugger/qqmlprofilerservice_p.h @@ -46,6 +46,7 @@ // #include "qqmlconfigurabledebugservice_p.h" +#include "qqmldebugserviceinterfaces_p.h" #include "qqmlprofilerdefinitions_p.h" #include "qqmlabstractprofileradapter_p.h" @@ -67,14 +68,14 @@ class QUrl; class QQmlEngine; -class Q_QML_PRIVATE_EXPORT QQmlProfilerService : - public QQmlConfigurableDebugService, +class Q_QML_PRIVATE_EXPORT QQmlProfilerServiceImpl : + public QQmlConfigurableDebugService, public QQmlProfilerDefinitions { Q_OBJECT public: - static QQmlProfilerService *instance(); + static QQmlProfilerServiceImpl *instance(); void engineAboutToBeAdded(QQmlEngine *engine); void engineAboutToBeRemoved(QQmlEngine *engine); void engineAdded(QQmlEngine *engine); @@ -86,8 +87,8 @@ public: void startProfiling(QQmlEngine *engine, quint64 features = std::numeric_limits::max()); void stopProfiling(QQmlEngine *engine); - QQmlProfilerService(); - ~QQmlProfilerService(); + QQmlProfilerServiceImpl(); + ~QQmlProfilerServiceImpl(); void dataReady(QQmlAbstractProfilerAdapter *profiler); diff --git a/src/qml/debugger/qv4debugservice.cpp b/src/qml/debugger/qv4debugservice.cpp index 63673a0..94755bd 100644 --- a/src/qml/debugger/qv4debugservice.cpp +++ b/src/qml/debugger/qv4debugservice.cpp @@ -58,7 +58,7 @@ const char *const V4_PAUSE = "interrupt"; QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QV4DebugService, v4ServiceInstance) +Q_GLOBAL_STATIC(QV4DebugServiceImpl, v4ServiceInstance) class V8CommandHandler; class UnknownV8CommandHandler; @@ -305,8 +305,8 @@ private: QHash objectRefs; }; -int QV4DebugService::debuggerIndex = 0; -int QV4DebugService::sequence = 0; +int QV4DebugServiceImpl::debuggerIndex = 0; +int QV4DebugServiceImpl::sequence = 0; class V8CommandHandler { @@ -320,7 +320,7 @@ public: QString command() const { return cmd; } - void handle(const QJsonObject &request, QV4DebugService *s) + void handle(const QJsonObject &request, QV4DebugServiceImpl *s) { TRACE_PROTOCOL(qDebug() << "handling command" << command() << "..."); @@ -378,7 +378,7 @@ protected: QString cmd; QJsonObject req; QJsonValue seq; - QV4DebugService *debugService; + QV4DebugServiceImpl *debugService; QJsonObject response; }; @@ -817,12 +817,12 @@ public: }; } // anonymous namespace -void QV4DebugService::addHandler(V8CommandHandler* handler) +void QV4DebugServiceImpl::addHandler(V8CommandHandler* handler) { handlers[handler->command()] = handler; } -V8CommandHandler *QV4DebugService::v8CommandHandler(const QString &command) const +V8CommandHandler *QV4DebugServiceImpl::v8CommandHandler(const QString &command) const { V8CommandHandler *handler = handlers.value(command, 0); if (handler) @@ -831,8 +831,8 @@ V8CommandHandler *QV4DebugService::v8CommandHandler(const QString &command) cons return unknownV8CommandHandler.data(); } -QV4DebugService::QV4DebugService(QObject *parent) : - QQmlConfigurableDebugService(QStringLiteral("V8Debugger"), 1, parent), +QV4DebugServiceImpl::QV4DebugServiceImpl(QObject *parent) : + QQmlConfigurableDebugService(1, parent), debuggerAgent(this), version(1), theSelectedFrame(0), unknownV8CommandHandler(new UnknownV8CommandHandler) { @@ -850,17 +850,17 @@ QV4DebugService::QV4DebugService(QObject *parent) : addHandler(new V8EvaluateRequest); } -QV4DebugService::~QV4DebugService() +QV4DebugServiceImpl::~QV4DebugServiceImpl() { qDeleteAll(handlers); } -QV4DebugService *QV4DebugService::instance() +QV4DebugServiceImpl *QV4DebugServiceImpl::instance() { return v4ServiceInstance(); } -void QV4DebugService::engineAboutToBeAdded(QQmlEngine *engine) +void QV4DebugServiceImpl::engineAboutToBeAdded(QQmlEngine *engine) { QMutexLocker lock(&m_configMutex); if (engine) { @@ -876,10 +876,10 @@ void QV4DebugService::engineAboutToBeAdded(QQmlEngine *engine) } } } - QQmlConfigurableDebugService::engineAboutToBeAdded(engine); + QQmlConfigurableDebugService::engineAboutToBeAdded(engine); } -void QV4DebugService::engineAboutToBeRemoved(QQmlEngine *engine) +void QV4DebugServiceImpl::engineAboutToBeRemoved(QQmlEngine *engine) { QMutexLocker lock(&m_configMutex); if (engine){ @@ -897,10 +897,10 @@ void QV4DebugService::engineAboutToBeRemoved(QQmlEngine *engine) debuggerAgent.removeDebugger(debugger); } } - QQmlConfigurableDebugService::engineAboutToBeRemoved(engine); + QQmlConfigurableDebugService::engineAboutToBeRemoved(engine); } -void QV4DebugService::signalEmitted(const QString &signal) +void QV4DebugServiceImpl::signalEmitted(const QString &signal) { //This function is only called by QQmlBoundSignal //only if there is a slot connected to the signal. Hence, there @@ -918,7 +918,7 @@ void QV4DebugService::signalEmitted(const QString &signal) } } -void QV4DebugService::messageReceived(const QByteArray &message) +void QV4DebugServiceImpl::messageReceived(const QByteArray &message) { QMutexLocker lock(&m_configMutex); @@ -961,7 +961,7 @@ void QV4DebugService::messageReceived(const QByteArray &message) } } -void QV4DebugService::sendSomethingToSomebody(const char *type, int magicNumber) +void QV4DebugServiceImpl::sendSomethingToSomebody(const char *type, int magicNumber) { QByteArray response; QQmlDebugStream rs(&response, QIODevice::WriteOnly); @@ -970,7 +970,7 @@ void QV4DebugService::sendSomethingToSomebody(const char *type, int magicNumber) emit messageToClient(name(), packMessage(type, response)); } -QV4DebuggerAgent::QV4DebuggerAgent(QV4DebugService *debugService) +QV4DebuggerAgent::QV4DebuggerAgent(QV4DebugServiceImpl *debugService) : debugService(debugService) {} @@ -1054,7 +1054,7 @@ void QV4DebuggerAgent::sourcesCollected(QV4::Debugging::Debugger *debugger, QStr debugService->send(response); } -void QV4DebugService::handleV8Request(const QByteArray &payload) +void QV4DebugServiceImpl::handleV8Request(const QByteArray &payload) { TRACE_PROTOCOL(qDebug() << "v8request, payload:" << payload.constData()); @@ -1069,7 +1069,7 @@ void QV4DebugService::handleV8Request(const QByteArray &payload) } } -QByteArray QV4DebugService::packMessage(const QByteArray &command, const QByteArray &message) +QByteArray QV4DebugServiceImpl::packMessage(const QByteArray &command, const QByteArray &message) { QByteArray reply; QQmlDebugStream rs(&reply, QIODevice::WriteOnly); @@ -1078,7 +1078,7 @@ QByteArray QV4DebugService::packMessage(const QByteArray &command, const QByteAr return reply; } -void QV4DebugService::send(QJsonObject v8Payload) +void QV4DebugServiceImpl::send(QJsonObject v8Payload) { v8Payload[QLatin1String("seq")] = sequence++; QJsonDocument doc; @@ -1094,12 +1094,12 @@ void QV4DebugService::send(QJsonObject v8Payload) emit messageToClient(name(), packMessage("v8message", responseData)); } -void QV4DebugService::clearHandles(QV4::ExecutionEngine *engine) +void QV4DebugServiceImpl::clearHandles(QV4::ExecutionEngine *engine) { theCollector.reset(new VariableCollector(engine)); } -QJsonObject QV4DebugService::buildFrame(const QV4::StackFrame &stackFrame, int frameNr, +QJsonObject QV4DebugServiceImpl::buildFrame(const QV4::StackFrame &stackFrame, int frameNr, QV4::Debugging::Debugger *debugger) { QJsonObject frame; @@ -1137,7 +1137,7 @@ QJsonObject QV4DebugService::buildFrame(const QV4::StackFrame &stackFrame, int f return frame; } -int QV4DebugService::encodeScopeType(QV4::Heap::ExecutionContext::ContextType scopeType) +int QV4DebugServiceImpl::encodeScopeType(QV4::Heap::ExecutionContext::ContextType scopeType) { switch (scopeType) { case QV4::Heap::ExecutionContext::Type_GlobalContext: @@ -1159,7 +1159,7 @@ int QV4DebugService::encodeScopeType(QV4::Heap::ExecutionContext::ContextType sc } } -QJsonObject QV4DebugService::buildScope(int frameNr, int scopeNr, +QJsonObject QV4DebugServiceImpl::buildScope(int frameNr, int scopeNr, QV4::Debugging::Debugger *debugger) { QJsonObject scope; @@ -1179,27 +1179,27 @@ QJsonObject QV4DebugService::buildScope(int frameNr, int scopeNr, return scope; } -QJsonValue QV4DebugService::lookup(int refId) const +QJsonValue QV4DebugServiceImpl::lookup(int refId) const { return theCollector->lookup(refId); } -QJsonArray QV4DebugService::buildRefs() +QJsonArray QV4DebugServiceImpl::buildRefs() { return theCollector->retrieveRefsToInclude(); } -VariableCollector *QV4DebugService::collector() const +VariableCollector *QV4DebugServiceImpl::collector() const { return theCollector.data(); } -void QV4DebugService::selectFrame(int frameNr) +void QV4DebugServiceImpl::selectFrame(int frameNr) { theSelectedFrame = frameNr; } -int QV4DebugService::selectedFrame() const +int QV4DebugServiceImpl::selectedFrame() const { return theSelectedFrame; } diff --git a/src/qml/debugger/qv4debugservice_p.h b/src/qml/debugger/qv4debugservice_p.h index 4e7806f..fee0e0a 100644 --- a/src/qml/debugger/qv4debugservice_p.h +++ b/src/qml/debugger/qv4debugservice_p.h @@ -46,6 +46,7 @@ // #include "qqmlconfigurabledebugservice_p.h" +#include "qqmldebugserviceinterfaces_p.h" #include #include @@ -58,13 +59,13 @@ class QQmlEngine; class VariableCollector; class V8CommandHandler; class UnknownV8CommandHandler; -class QV4DebugService; +class QV4DebugServiceImpl; class QV4DebuggerAgent : public QV4::Debugging::DebuggerAgent { Q_OBJECT public: - QV4DebuggerAgent(QV4DebugService *debugService); + QV4DebuggerAgent(QV4DebugServiceImpl *debugService); QV4::Debugging::Debugger *firstDebugger() const; bool isRunning() const; @@ -75,17 +76,17 @@ public slots: int requestSequenceNr); private: - QV4DebugService *debugService; + QV4DebugServiceImpl *debugService; }; -class QV4DebugService : public QQmlConfigurableDebugService +class QV4DebugServiceImpl : public QQmlConfigurableDebugService { Q_OBJECT public: - explicit QV4DebugService(QObject *parent = 0); - ~QV4DebugService(); + explicit QV4DebugServiceImpl(QObject *parent = 0); + ~QV4DebugServiceImpl(); - static QV4DebugService *instance(); + static QV4DebugServiceImpl *instance(); void engineAboutToBeAdded(QQmlEngine *engine); void engineAboutToBeRemoved(QQmlEngine *engine); diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index e0cd594..9577e10 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -321,7 +321,7 @@ void QQmlBoundSignal_callback(QQmlNotifierEndpoint *e, void **a) return; if (QQmlDebugConnector::instance()) - QV4DebugService::instance()->signalEmitted(QString::fromLatin1(QMetaObjectPrivate::signal(s->m_expression->target()->metaObject(), s->signalIndex()).methodSignature())); + QV4DebugServiceImpl::instance()->signalEmitted(QString::fromLatin1(QMetaObjectPrivate::signal(s->m_expression->target()->metaObject(), s->signalIndex()).methodSignature())); QQmlEngine *engine; if (s->m_expression && (engine = s->m_expression->engine())) { diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index d46f612..efa4270 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -898,7 +898,7 @@ QQmlComponentPrivate::beginCreate(QQmlContextData *context) if (enginePriv->isDebugging && rv) { if (!context->isInternal) context->asQQmlContextPrivate()->instances.append(rv); - QQmlEngineDebugService::instance()->objectCreated(engine, rv); + QQmlEngineDebugServiceImpl::instance()->objectCreated(engine, rv); } return rv; diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index f2918bb..4f750bb 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -1451,7 +1451,7 @@ QV4::ReturnedValue ConsoleObject::method_profile(CallContext *ctx) if (!QQmlDebugConnector::instance()) { logger.warning("Cannot start profiling because debug service is disabled. Start with -qmljsdebugger=port:XXXXX."); } else { - QQmlProfilerService::instance()->startProfiling(v4->qmlEngine()); + QQmlProfilerServiceImpl::instance()->startProfiling(v4->qmlEngine()); logger.debug("Profiling started."); } @@ -1470,7 +1470,7 @@ QV4::ReturnedValue ConsoleObject::method_profileEnd(CallContext *ctx) if (!QQmlDebugConnector::instance()) { logger.warning("Ignoring console.profileEnd(): the debug service is disabled."); } else { - QQmlProfilerService::instance()->stopProfiling(v4->qmlEngine()); + QQmlProfilerServiceImpl::instance()->stopProfiling(v4->qmlEngine()); logger.debug("Profiling ended."); } diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp index ff1f225..2fbd68b 100644 --- a/src/quick/items/qquickview.cpp +++ b/src/quick/items/qquickview.cpp @@ -88,7 +88,7 @@ void QQuickViewPrivate::init(QQmlEngine* e) } if (QQmlDebugConnector::instance()) - QQmlInspectorService::instance()->addView(q); + QQmlInspectorServiceImpl::instance()->addView(q); } QQuickViewPrivate::QQuickViewPrivate() @@ -99,7 +99,7 @@ QQuickViewPrivate::QQuickViewPrivate() QQuickViewPrivate::~QQuickViewPrivate() { if (QQmlDebugConnector::instance()) - QQmlInspectorService::instance()->removeView(q_func()); + QQmlInspectorServiceImpl::instance()->removeView(q_func()); } void QQuickViewPrivate::execute() diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp index 3e7811e..acf7c3e 100644 --- a/src/quick/qtquick2.cpp +++ b/src/quick/qtquick2.cpp @@ -188,7 +188,7 @@ void QQmlQtQuick2Module::defineModule() #endif if (QQmlDebugConnector::instance()) { - QQmlEngineDebugService::instance()->setStatesDelegate( + QQmlEngineDebugServiceImpl::instance()->setStatesDelegate( new QQmlQtQuick2DebugStatesDelegate); QQuickProfiler::initialize(); } diff --git a/src/quick/util/qquickprofiler.cpp b/src/quick/util/qquickprofiler.cpp index 7bd32f0..c3cd062 100644 --- a/src/quick/util/qquickprofiler.cpp +++ b/src/quick/util/qquickprofiler.cpp @@ -127,9 +127,9 @@ qint64 QQuickProfiler::sendMessages(qint64 until, QList &messages) void QQuickProfiler::initialize() { Q_ASSERT(s_instance == 0); - QQmlProfilerService *service = QQmlProfilerService::instance(); + QQmlProfilerServiceImpl *service = QQmlProfilerServiceImpl::instance(); s_instance = new QQuickProfiler(service); - QQmlProfilerService::instance()->addGlobalProfiler(s_instance); + QQmlProfilerServiceImpl::instance()->addGlobalProfiler(s_instance); } void animationTimerCallback(qint64 delta) diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 553dba3..e6892bd 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -97,7 +97,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e) engine.data()->setIncubationController(offscreenWindow->incubationController()); if (QQmlDebugConnector::instance()) - QQmlInspectorService::instance()->addView(q); + QQmlInspectorServiceImpl::instance()->addView(q); #ifndef QT_NO_DRAGANDDROP q->setAcceptDrops(true); @@ -150,7 +150,7 @@ QQuickWidgetPrivate::QQuickWidgetPrivate() QQuickWidgetPrivate::~QQuickWidgetPrivate() { if (QQmlDebugConnector::instance()) - QQmlInspectorService::instance()->removeView(q_func()); + QQmlInspectorServiceImpl::instance()->removeView(q_func()); invalidateRenderControl(); -- 2.7.4