From a07f68eff5ac4696a551f083d186a685f7ef043d Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 31 Aug 2011 09:12:39 +0200 Subject: [PATCH] Debugger: Rename qdeclarativedebug* to qdeclarativeenginedebug* Change-Id: I0c289bdf555aa317dc12c5dbcff0168ebcc7bd50 Reviewed-on: http://codereview.qt.nokia.com/3935 Reviewed-by: Qt Sanity Bot Reviewed-by: Aurindam Jana --- src/declarative/debugger/debugger.pri | 4 +- src/declarative/debugger/qdeclarativedebug.cpp | 1068 -------------------- src/declarative/debugger/qdeclarativedebug_p.h | 387 ------- .../debugger/qdeclarativeenginedebug.cpp | 1068 ++++++++++++++++++++ .../debugger/qdeclarativeenginedebug_p.h | 387 +++++++ .../qdeclarativedebug/tst_qdeclarativedebug.cpp | 2 +- .../tst_qdeclarativedebugclient.cpp | 3 - .../tst_qdeclarativedebugservice.cpp | 1 - 8 files changed, 1458 insertions(+), 1462 deletions(-) delete mode 100644 src/declarative/debugger/qdeclarativedebug.cpp delete mode 100644 src/declarative/debugger/qdeclarativedebug_p.h create mode 100644 src/declarative/debugger/qdeclarativeenginedebug.cpp create mode 100644 src/declarative/debugger/qdeclarativeenginedebug_p.h diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 8124774..f2790c4 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -5,7 +5,7 @@ SOURCES += \ $$PWD/qpacketprotocol.cpp \ $$PWD/qdeclarativedebugservice.cpp \ $$PWD/qdeclarativedebugclient.cpp \ - $$PWD/qdeclarativedebug.cpp \ + $$PWD/qdeclarativeenginedebug.cpp \ $$PWD/qdeclarativedebugtrace.cpp \ $$PWD/qdeclarativedebughelper.cpp \ $$PWD/qdeclarativedebugserver.cpp \ @@ -19,7 +19,7 @@ HEADERS += \ $$PWD/qdeclarativedebugservice_p.h \ $$PWD/qdeclarativedebugservice_p_p.h \ $$PWD/qdeclarativedebugclient_p.h \ - $$PWD/qdeclarativedebug_p.h \ + $$PWD/qdeclarativeenginedebug_p.h \ $$PWD/qdeclarativedebugtrace_p.h \ $$PWD/qdeclarativedebughelper_p.h \ $$PWD/qdeclarativedebugserver_p.h \ diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp deleted file mode 100644 index 17bd553..0000000 --- a/src/declarative/debugger/qdeclarativedebug.cpp +++ /dev/null @@ -1,1068 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "private/qdeclarativedebug_p.h" - -#include "private/qdeclarativedebugclient_p.h" - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QDeclarativeEngineDebugClient : public QDeclarativeDebugClient -{ -public: - QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, QDeclarativeEngineDebugPrivate *p); - -protected: - virtual void statusChanged(Status status); - virtual void messageReceived(const QByteArray &); - -private: - QDeclarativeEngineDebugPrivate *priv; - friend class QDeclarativeEngineDebugPrivate; -}; - -class QDeclarativeEngineDebugPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QDeclarativeEngineDebug) -public: - QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *); - ~QDeclarativeEngineDebugPrivate(); - - void statusChanged(QDeclarativeEngineDebug::Status status); - void message(const QByteArray &); - - QDeclarativeEngineDebugClient *client; - int nextId; - int getId(); - - void decode(QDataStream &, QDeclarativeDebugContextReference &); - void decode(QDataStream &, QDeclarativeDebugObjectReference &, bool simple); - - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugEnginesQuery *); - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugRootContextQuery *); - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugObjectQuery *); - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugExpressionQuery *); - static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugWatch *); - - QHash enginesQuery; - QHash rootContextQuery; - QHash objectQuery; - QHash expressionQuery; - - QHash watched; -}; - -QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, - QDeclarativeEngineDebugPrivate *p) -: QDeclarativeDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p) -{ -} - -void QDeclarativeEngineDebugClient::statusChanged(Status status) -{ - if (priv) - priv->statusChanged(static_cast(status)); -} - -void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data) -{ - if (priv) - priv->message(data); -} - -QDeclarativeEngineDebugPrivate::QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *c) -: client(new QDeclarativeEngineDebugClient(c, this)), nextId(0) -{ -} - -QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate() -{ - if (client) - client->priv = 0; - delete client; - - QHash::iterator enginesIter = enginesQuery.begin(); - for (; enginesIter != enginesQuery.end(); ++enginesIter) { - enginesIter.value()->m_client = 0; - if (enginesIter.value()->state() == QDeclarativeDebugQuery::Waiting) - enginesIter.value()->setState(QDeclarativeDebugQuery::Error); - } - - QHash::iterator rootContextIter = rootContextQuery.begin(); - for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) { - rootContextIter.value()->m_client = 0; - if (rootContextIter.value()->state() == QDeclarativeDebugQuery::Waiting) - rootContextIter.value()->setState(QDeclarativeDebugQuery::Error); - } - - QHash::iterator objectIter = objectQuery.begin(); - for (; objectIter != objectQuery.end(); ++objectIter) { - objectIter.value()->m_client = 0; - if (objectIter.value()->state() == QDeclarativeDebugQuery::Waiting) - objectIter.value()->setState(QDeclarativeDebugQuery::Error); - } - - QHash::iterator exprIter = expressionQuery.begin(); - for (; exprIter != expressionQuery.end(); ++exprIter) { - exprIter.value()->m_client = 0; - if (exprIter.value()->state() == QDeclarativeDebugQuery::Waiting) - exprIter.value()->setState(QDeclarativeDebugQuery::Error); - } - - QHash::iterator watchIter = watched.begin(); - for (; watchIter != watched.end(); ++watchIter) { - watchIter.value()->m_client = 0; - watchIter.value()->setState(QDeclarativeDebugWatch::Dead); - } -} - -int QDeclarativeEngineDebugPrivate::getId() -{ - return nextId++; -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugEnginesQuery *q) -{ - if (c && q) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->enginesQuery.remove(q->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, - QDeclarativeDebugRootContextQuery *q) -{ - if (c && q) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->rootContextQuery.remove(q->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugObjectQuery *q) -{ - if (c && q) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->objectQuery.remove(q->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugExpressionQuery *q) -{ - if (c && q) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->expressionQuery.remove(q->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugWatch *w) -{ - if (c && w) { - QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); - p->watched.remove(w->m_queryId); - } -} - -void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o, - bool simple) -{ - QDeclarativeEngineDebugService::QDeclarativeObjectData data; - ds >> data; - o.m_debugId = data.objectId; - o.m_class = data.objectType; - o.m_idString = data.idString; - o.m_name = data.objectName; - o.m_source.m_url = data.url; - o.m_source.m_lineNumber = data.lineNumber; - o.m_source.m_columnNumber = data.columnNumber; - o.m_contextDebugId = data.contextId; - - if (simple) - return; - - int childCount; - bool recur; - ds >> childCount >> recur; - - for (int ii = 0; ii < childCount; ++ii) { - o.m_children.append(QDeclarativeDebugObjectReference()); - decode(ds, o.m_children.last(), !recur); - } - - int propCount; - ds >> propCount; - - for (int ii = 0; ii < propCount; ++ii) { - QDeclarativeEngineDebugService::QDeclarativeObjectProperty data; - ds >> data; - QDeclarativeDebugPropertyReference prop; - prop.m_objectDebugId = o.m_debugId; - prop.m_name = data.name; - prop.m_binding = data.binding; - prop.m_hasNotifySignal = data.hasNotifySignal; - prop.m_valueTypeName = data.valueTypeName; - switch (data.type) { - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic: - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List: - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty: - { - prop.m_value = data.value; - break; - } - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object: - { - QDeclarativeDebugObjectReference obj; - obj.m_debugId = prop.m_value.toInt(); - prop.m_value = QVariant::fromValue(obj); - break; - } - case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown: - break; - } - o.m_properties << prop; - } -} - -void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugContextReference &c) -{ - ds >> c.m_name >> c.m_debugId; - - int contextCount; - ds >> contextCount; - - for (int ii = 0; ii < contextCount; ++ii) { - c.m_contexts.append(QDeclarativeDebugContextReference()); - decode(ds, c.m_contexts.last()); - } - - int objectCount; - ds >> objectCount; - - for (int ii = 0; ii < objectCount; ++ii) { - QDeclarativeDebugObjectReference obj; - decode(ds, obj, true); - - obj.m_contextDebugId = c.m_debugId; - c.m_objects << obj; - } -} - -void QDeclarativeEngineDebugPrivate::statusChanged(QDeclarativeEngineDebug::Status status) -{ - emit q_func()->statusChanged(status); -} - -void QDeclarativeEngineDebugPrivate::message(const QByteArray &data) -{ - QDataStream ds(data); - - QByteArray type; - ds >> type; - - //qDebug() << "QDeclarativeEngineDebugPrivate::message()" << type; - - if (type == "LIST_ENGINES_R") { - int queryId; - ds >> queryId; - - QDeclarativeDebugEnginesQuery *query = enginesQuery.value(queryId); - if (!query) - return; - enginesQuery.remove(queryId); - - int count; - ds >> count; - - for (int ii = 0; ii < count; ++ii) { - QDeclarativeDebugEngineReference ref; - ds >> ref.m_name; - ds >> ref.m_debugId; - query->m_engines << ref; - } - - query->m_client = 0; - query->setState(QDeclarativeDebugQuery::Completed); - } else if (type == "LIST_OBJECTS_R") { - int queryId; - ds >> queryId; - - QDeclarativeDebugRootContextQuery *query = rootContextQuery.value(queryId); - if (!query) - return; - rootContextQuery.remove(queryId); - - if (!ds.atEnd()) - decode(ds, query->m_context); - - query->m_client = 0; - query->setState(QDeclarativeDebugQuery::Completed); - } else if (type == "FETCH_OBJECT_R") { - int queryId; - ds >> queryId; - - QDeclarativeDebugObjectQuery *query = objectQuery.value(queryId); - if (!query) - return; - objectQuery.remove(queryId); - - if (!ds.atEnd()) - decode(ds, query->m_object, false); - - query->m_client = 0; - query->setState(QDeclarativeDebugQuery::Completed); - } else if (type == "EVAL_EXPRESSION_R") { - int queryId; - QVariant result; - ds >> queryId >> result; - - QDeclarativeDebugExpressionQuery *query = expressionQuery.value(queryId); - if (!query) - return; - expressionQuery.remove(queryId); - - query->m_result = result; - query->m_client = 0; - query->setState(QDeclarativeDebugQuery::Completed); - } else if (type == "WATCH_PROPERTY_R") { - int queryId; - bool ok; - ds >> queryId >> ok; - - QDeclarativeDebugWatch *watch = watched.value(queryId); - if (!watch) - return; - - watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); - } else if (type == "WATCH_OBJECT_R") { - int queryId; - bool ok; - ds >> queryId >> ok; - - QDeclarativeDebugWatch *watch = watched.value(queryId); - if (!watch) - return; - - watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); - } else if (type == "WATCH_EXPR_OBJECT_R") { - int queryId; - bool ok; - ds >> queryId >> ok; - - QDeclarativeDebugWatch *watch = watched.value(queryId); - if (!watch) - return; - - watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); - } else if (type == "UPDATE_WATCH") { - int queryId; - int debugId; - QByteArray name; - QVariant value; - ds >> queryId >> debugId >> name >> value; - - QDeclarativeDebugWatch *watch = watched.value(queryId, 0); - if (!watch) - return; - emit watch->valueChanged(name, value); - } else if (type == "OBJECT_CREATED") { - emit q_func()->newObjects(); - } -} - -QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent) -: QObject(*(new QDeclarativeEngineDebugPrivate(client)), parent) -{ -} - -QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const -{ - Q_D(const QDeclarativeEngineDebug); - - return static_cast(d->client->status()); -} - -QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugPropertyWatch *watch = new QDeclarativeDebugPropertyWatch(parent); - if (d->client->status() == QDeclarativeDebugClient::Enabled) { - int queryId = d->getId(); - watch->m_queryId = queryId; - watch->m_client = this; - watch->m_objectDebugId = property.objectDebugId(); - watch->m_name = property.name(); - d->watched.insert(queryId, watch); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8(); - d->client->sendMessage(message); - } else { - watch->m_state = QDeclarativeDebugWatch::Dead; - } - - return watch; -} - -QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugContextReference &, const QString &, QObject *) -{ - qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented"); - return 0; -} - -QDeclarativeDebugObjectExpressionWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, const QString &expr, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - QDeclarativeDebugObjectExpressionWatch *watch = new QDeclarativeDebugObjectExpressionWatch(parent); - if (d->client->status() == QDeclarativeDebugClient::Enabled) { - int queryId = d->getId(); - watch->m_queryId = queryId; - watch->m_client = this; - watch->m_objectDebugId = object.debugId(); - watch->m_expr = expr; - d->watched.insert(queryId, watch); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr; - d->client->sendMessage(message); - } else { - watch->m_state = QDeclarativeDebugWatch::Dead; - } - return watch; -} - -QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugWatch *watch = new QDeclarativeDebugWatch(parent); - if (d->client->status() == QDeclarativeDebugClient::Enabled) { - int queryId = d->getId(); - watch->m_queryId = queryId; - watch->m_client = this; - watch->m_objectDebugId = object.debugId(); - d->watched.insert(queryId, watch); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId(); - d->client->sendMessage(message); - } else { - watch->m_state = QDeclarativeDebugWatch::Dead; - } - - return watch; -} - -QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugFileReference &, QObject *) -{ - qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented"); - return 0; -} - -void QDeclarativeEngineDebug::removeWatch(QDeclarativeDebugWatch *watch) -{ - Q_D(QDeclarativeEngineDebug); - - if (!watch || !watch->m_client) - return; - - watch->m_client = 0; - watch->setState(QDeclarativeDebugWatch::Inactive); - - d->watched.remove(watch->queryId()); - - if (d->client && d->client->status() == QDeclarativeDebugClient::Enabled) { - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("NO_WATCH") << watch->queryId(); - d->client->sendMessage(message); - } -} - -QDeclarativeDebugEnginesQuery *QDeclarativeEngineDebug::queryAvailableEngines(QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugEnginesQuery *query = new QDeclarativeDebugEnginesQuery(parent); - if (d->client->status() == QDeclarativeDebugClient::Enabled) { - query->m_client = this; - int queryId = d->getId(); - query->m_queryId = queryId; - d->enginesQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("LIST_ENGINES") << queryId; - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -QDeclarativeDebugRootContextQuery *QDeclarativeEngineDebug::queryRootContexts(const QDeclarativeDebugEngineReference &engine, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugRootContextQuery *query = new QDeclarativeDebugRootContextQuery(parent); - if (d->client->status() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) { - query->m_client = this; - int queryId = d->getId(); - query->m_queryId = queryId; - d->rootContextQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId(); - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObject(const QDeclarativeDebugObjectReference &object, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent); - if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) { - query->m_client = this; - int queryId = d->getId(); - query->m_queryId = queryId; - d->objectQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId() - << false << true; - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObjectRecursive(const QDeclarativeDebugObjectReference &object, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent); - if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) { - query->m_client = this; - int queryId = d->getId(); - query->m_queryId = queryId; - d->objectQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId() - << true << true; - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent) -{ - Q_D(QDeclarativeEngineDebug); - - QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent); - if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { - query->m_client = this; - query->m_expr = expr; - int queryId = d->getId(); - query->m_queryId = queryId; - d->expressionQuery.insert(queryId, query); - - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr; - d->client->sendMessage(message); - } else { - query->m_state = QDeclarativeDebugQuery::Error; - } - - return query; -} - -bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName, - const QVariant &bindingExpression, - bool isLiteralValue, - QString source, int line) -{ - Q_D(QDeclarativeEngineDebug); - - if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line; - d->client->sendMessage(message); - return true; - } else { - return false; - } -} - -bool QDeclarativeEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName) -{ - Q_D(QDeclarativeEngineDebug); - - if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName; - d->client->sendMessage(message); - return true; - } else { - return false; - } -} - -bool QDeclarativeEngineDebug::setMethodBody(int objectDebugId, const QString &methodName, - const QString &methodBody) -{ - Q_D(QDeclarativeEngineDebug); - - if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody; - d->client->sendMessage(message); - return true; - } else { - return false; - } -} - -QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent) -: QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1) -{ -} - -QDeclarativeDebugWatch::~QDeclarativeDebugWatch() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -int QDeclarativeDebugWatch::queryId() const -{ - return m_queryId; -} - -int QDeclarativeDebugWatch::objectDebugId() const -{ - return m_objectDebugId; -} - -QDeclarativeDebugWatch::State QDeclarativeDebugWatch::state() const -{ - return m_state; -} - -void QDeclarativeDebugWatch::setState(State s) -{ - if (m_state == s) - return; - m_state = s; - emit stateChanged(m_state); -} - -QDeclarativeDebugPropertyWatch::QDeclarativeDebugPropertyWatch(QObject *parent) - : QDeclarativeDebugWatch(parent) -{ -} - -QString QDeclarativeDebugPropertyWatch::name() const -{ - return m_name; -} - - -QDeclarativeDebugObjectExpressionWatch::QDeclarativeDebugObjectExpressionWatch(QObject *parent) - : QDeclarativeDebugWatch(parent) -{ -} - -QString QDeclarativeDebugObjectExpressionWatch::expression() const -{ - return m_expr; -} - - -QDeclarativeDebugQuery::QDeclarativeDebugQuery(QObject *parent) -: QObject(parent), m_state(Waiting) -{ -} - -QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state() const -{ - return m_state; -} - -bool QDeclarativeDebugQuery::isWaiting() const -{ - return m_state == Waiting; -} - -void QDeclarativeDebugQuery::setState(State s) -{ - if (m_state == s) - return; - m_state = s; - emit stateChanged(m_state); -} - -QDeclarativeDebugEnginesQuery::QDeclarativeDebugEnginesQuery(QObject *parent) -: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) -{ -} - -QDeclarativeDebugEnginesQuery::~QDeclarativeDebugEnginesQuery() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -QList QDeclarativeDebugEnginesQuery::engines() const -{ - return m_engines; -} - -QDeclarativeDebugRootContextQuery::QDeclarativeDebugRootContextQuery(QObject *parent) -: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) -{ -} - -QDeclarativeDebugRootContextQuery::~QDeclarativeDebugRootContextQuery() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -QDeclarativeDebugContextReference QDeclarativeDebugRootContextQuery::rootContext() const -{ - return m_context; -} - -QDeclarativeDebugObjectQuery::QDeclarativeDebugObjectQuery(QObject *parent) -: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) -{ -} - -QDeclarativeDebugObjectQuery::~QDeclarativeDebugObjectQuery() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -QDeclarativeDebugObjectReference QDeclarativeDebugObjectQuery::object() const -{ - return m_object; -} - -QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(QObject *parent) -: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) -{ -} - -QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery() -{ - if (m_client && m_queryId != -1) - QDeclarativeEngineDebugPrivate::remove(m_client, this); -} - -QVariant QDeclarativeDebugExpressionQuery::expression() const -{ - return m_expr; -} - -QVariant QDeclarativeDebugExpressionQuery::result() const -{ - return m_result; -} - -QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference() -: m_debugId(-1) -{ -} - -QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(int debugId) -: m_debugId(debugId) -{ -} - -QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &o) -: m_debugId(o.m_debugId), m_name(o.m_name) -{ -} - -QDeclarativeDebugEngineReference & -QDeclarativeDebugEngineReference::operator=(const QDeclarativeDebugEngineReference &o) -{ - m_debugId = o.m_debugId; m_name = o.m_name; - return *this; -} - -int QDeclarativeDebugEngineReference::debugId() const -{ - return m_debugId; -} - -QString QDeclarativeDebugEngineReference::name() const -{ - return m_name; -} - -QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference() -: m_debugId(-1), m_contextDebugId(-1) -{ -} - -QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(int debugId) -: m_debugId(debugId), m_contextDebugId(-1) -{ -} - -QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &o) -: m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString), - m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId), - m_properties(o.m_properties), m_children(o.m_children) -{ -} - -QDeclarativeDebugObjectReference & -QDeclarativeDebugObjectReference::operator=(const QDeclarativeDebugObjectReference &o) -{ - m_debugId = o.m_debugId; m_class = o.m_class; m_idString = o.m_idString; - m_name = o.m_name; m_source = o.m_source; m_contextDebugId = o.m_contextDebugId; - m_properties = o.m_properties; m_children = o.m_children; - return *this; -} - -int QDeclarativeDebugObjectReference::debugId() const -{ - return m_debugId; -} - -QString QDeclarativeDebugObjectReference::className() const -{ - return m_class; -} - -QString QDeclarativeDebugObjectReference::idString() const -{ - return m_idString; -} - -QString QDeclarativeDebugObjectReference::name() const -{ - return m_name; -} - -QDeclarativeDebugFileReference QDeclarativeDebugObjectReference::source() const -{ - return m_source; -} - -int QDeclarativeDebugObjectReference::contextDebugId() const -{ - return m_contextDebugId; -} - -QList QDeclarativeDebugObjectReference::properties() const -{ - return m_properties; -} - -QList QDeclarativeDebugObjectReference::children() const -{ - return m_children; -} - -QDeclarativeDebugContextReference::QDeclarativeDebugContextReference() -: m_debugId(-1) -{ -} - -QDeclarativeDebugContextReference::QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &o) -: m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts) -{ -} - -QDeclarativeDebugContextReference &QDeclarativeDebugContextReference::operator=(const QDeclarativeDebugContextReference &o) -{ - m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects; - m_contexts = o.m_contexts; - return *this; -} - -int QDeclarativeDebugContextReference::debugId() const -{ - return m_debugId; -} - -QString QDeclarativeDebugContextReference::name() const -{ - return m_name; -} - -QList QDeclarativeDebugContextReference::objects() const -{ - return m_objects; -} - -QList QDeclarativeDebugContextReference::contexts() const -{ - return m_contexts; -} - -QDeclarativeDebugFileReference::QDeclarativeDebugFileReference() -: m_lineNumber(-1), m_columnNumber(-1) -{ -} - -QDeclarativeDebugFileReference::QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &o) -: m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber) -{ -} - -QDeclarativeDebugFileReference &QDeclarativeDebugFileReference::operator=(const QDeclarativeDebugFileReference &o) -{ - m_url = o.m_url; m_lineNumber = o.m_lineNumber; m_columnNumber = o.m_columnNumber; - return *this; -} - -QUrl QDeclarativeDebugFileReference::url() const -{ - return m_url; -} - -void QDeclarativeDebugFileReference::setUrl(const QUrl &u) -{ - m_url = u; -} - -int QDeclarativeDebugFileReference::lineNumber() const -{ - return m_lineNumber; -} - -void QDeclarativeDebugFileReference::setLineNumber(int l) -{ - m_lineNumber = l; -} - -int QDeclarativeDebugFileReference::columnNumber() const -{ - return m_columnNumber; -} - -void QDeclarativeDebugFileReference::setColumnNumber(int c) -{ - m_columnNumber = c; -} - -QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference() -: m_objectDebugId(-1), m_hasNotifySignal(false) -{ -} - -QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &o) -: m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value), - m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding), - m_hasNotifySignal(o.m_hasNotifySignal) -{ -} - -QDeclarativeDebugPropertyReference &QDeclarativeDebugPropertyReference::operator=(const QDeclarativeDebugPropertyReference &o) -{ - m_objectDebugId = o.m_objectDebugId; m_name = o.m_name; m_value = o.m_value; - m_valueTypeName = o.m_valueTypeName; m_binding = o.m_binding; - m_hasNotifySignal = o.m_hasNotifySignal; - return *this; -} - -int QDeclarativeDebugPropertyReference::objectDebugId() const -{ - return m_objectDebugId; -} - -QString QDeclarativeDebugPropertyReference::name() const -{ - return m_name; -} - -QString QDeclarativeDebugPropertyReference::valueTypeName() const -{ - return m_valueTypeName; -} - -QVariant QDeclarativeDebugPropertyReference::value() const -{ - return m_value; -} - -QString QDeclarativeDebugPropertyReference::binding() const -{ - return m_binding; -} - -bool QDeclarativeDebugPropertyReference::hasNotifySignal() const -{ - return m_hasNotifySignal; -} - -QT_END_NAMESPACE - diff --git a/src/declarative/debugger/qdeclarativedebug_p.h b/src/declarative/debugger/qdeclarativedebug_p.h deleted file mode 100644 index f822637..0000000 --- a/src/declarative/debugger/qdeclarativedebug_p.h +++ /dev/null @@ -1,387 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QDECLARATIVEDEBUG_H -#define QDECLARATIVEDEBUG_H - -#include -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeDebugConnection; -class QDeclarativeDebugWatch; -class QDeclarativeDebugPropertyWatch; -class QDeclarativeDebugObjectExpressionWatch; -class QDeclarativeDebugEnginesQuery; -class QDeclarativeDebugRootContextQuery; -class QDeclarativeDebugObjectQuery; -class QDeclarativeDebugExpressionQuery; -class QDeclarativeDebugPropertyReference; -class QDeclarativeDebugContextReference; -class QDeclarativeDebugObjectReference; -class QDeclarativeDebugFileReference; -class QDeclarativeDebugEngineReference; -class QDeclarativeEngineDebugPrivate; -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEngineDebug : public QObject -{ -Q_OBJECT -public: - enum Status { NotConnected, Unavailable, Enabled }; - - explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0); - - Status status() const; - - QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &, - QObject *parent = 0); - QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugContextReference &, const QString &, - QObject *parent = 0); - QDeclarativeDebugObjectExpressionWatch *addWatch(const QDeclarativeDebugObjectReference &, const QString &, - QObject *parent = 0); - QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugObjectReference &, - QObject *parent = 0); - QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugFileReference &, - QObject *parent = 0); - - void removeWatch(QDeclarativeDebugWatch *watch); - - QDeclarativeDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0); - QDeclarativeDebugRootContextQuery *queryRootContexts(const QDeclarativeDebugEngineReference &, - QObject *parent = 0); - QDeclarativeDebugObjectQuery *queryObject(const QDeclarativeDebugObjectReference &, - QObject *parent = 0); - QDeclarativeDebugObjectQuery *queryObjectRecursive(const QDeclarativeDebugObjectReference &, - QObject *parent = 0); - QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId, - const QString &expr, - QObject *parent = 0); - bool setBindingForObject(int objectDebugId, const QString &propertyName, - const QVariant &bindingExpression, bool isLiteralValue, - QString source = QString(), int line = -1); - bool resetBindingForObject(int objectDebugId, const QString &propertyName); - bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody); - -Q_SIGNALS: - void newObjects(); - void statusChanged(Status status); - -private: - Q_DECLARE_PRIVATE(QDeclarativeEngineDebug) -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugWatch : public QObject -{ -Q_OBJECT -public: - enum State { Waiting, Active, Inactive, Dead }; - - QDeclarativeDebugWatch(QObject *); - ~QDeclarativeDebugWatch(); - - int queryId() const; - int objectDebugId() const; - State state() const; - -Q_SIGNALS: - void stateChanged(QDeclarativeDebugWatch::State); - //void objectChanged(int, const QDeclarativeDebugObjectReference &); - //void valueChanged(int, const QVariant &); - - // Server sends value as string if it is a user-type variant - void valueChanged(const QByteArray &name, const QVariant &value); - -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - void setState(State); - State m_state; - int m_queryId; - QDeclarativeEngineDebug *m_client; - int m_objectDebugId; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugPropertyWatch : public QDeclarativeDebugWatch -{ - Q_OBJECT -public: - QDeclarativeDebugPropertyWatch(QObject *parent); - - QString name() const; - -private: - friend class QDeclarativeEngineDebug; - QString m_name; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectExpressionWatch : public QDeclarativeDebugWatch -{ - Q_OBJECT -public: - QDeclarativeDebugObjectExpressionWatch(QObject *parent); - - QString expression() const; - -private: - friend class QDeclarativeEngineDebug; - QString m_expr; - int m_debugId; -}; - - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugQuery : public QObject -{ -Q_OBJECT -public: - enum State { Waiting, Error, Completed }; - - State state() const; - bool isWaiting() const; - -// bool waitUntilCompleted(); - -Q_SIGNALS: - void stateChanged(QDeclarativeDebugQuery::State); - -protected: - QDeclarativeDebugQuery(QObject *); - -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - void setState(State); - State m_state; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugFileReference -{ -public: - QDeclarativeDebugFileReference(); - QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &); - QDeclarativeDebugFileReference &operator=(const QDeclarativeDebugFileReference &); - - QUrl url() const; - void setUrl(const QUrl &); - int lineNumber() const; - void setLineNumber(int); - int columnNumber() const; - void setColumnNumber(int); - -private: - friend class QDeclarativeEngineDebugPrivate; - QUrl m_url; - int m_lineNumber; - int m_columnNumber; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEngineReference -{ -public: - QDeclarativeDebugEngineReference(); - QDeclarativeDebugEngineReference(int); - QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &); - QDeclarativeDebugEngineReference &operator=(const QDeclarativeDebugEngineReference &); - - int debugId() const; - QString name() const; - -private: - friend class QDeclarativeEngineDebugPrivate; - int m_debugId; - QString m_name; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectReference -{ -public: - QDeclarativeDebugObjectReference(); - QDeclarativeDebugObjectReference(int); - QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &); - QDeclarativeDebugObjectReference &operator=(const QDeclarativeDebugObjectReference &); - - int debugId() const; - QString className() const; - QString idString() const; - QString name() const; - - QDeclarativeDebugFileReference source() const; - int contextDebugId() const; - - QList properties() const; - QList children() const; - -private: - friend class QDeclarativeEngineDebugPrivate; - int m_debugId; - QString m_class; - QString m_idString; - QString m_name; - QDeclarativeDebugFileReference m_source; - int m_contextDebugId; - QList m_properties; - QList m_children; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugContextReference -{ -public: - QDeclarativeDebugContextReference(); - QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &); - QDeclarativeDebugContextReference &operator=(const QDeclarativeDebugContextReference &); - - int debugId() const; - QString name() const; - - QList objects() const; - QList contexts() const; - -private: - friend class QDeclarativeEngineDebugPrivate; - int m_debugId; - QString m_name; - QList m_objects; - QList m_contexts; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugPropertyReference -{ -public: - QDeclarativeDebugPropertyReference(); - QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &); - QDeclarativeDebugPropertyReference &operator=(const QDeclarativeDebugPropertyReference &); - - int objectDebugId() const; - QString name() const; - QVariant value() const; - QString valueTypeName() const; - QString binding() const; - bool hasNotifySignal() const; - -private: - friend class QDeclarativeEngineDebugPrivate; - int m_objectDebugId; - QString m_name; - QVariant m_value; - QString m_valueTypeName; - QString m_binding; - bool m_hasNotifySignal; -}; - - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEnginesQuery : public QDeclarativeDebugQuery -{ -Q_OBJECT -public: - virtual ~QDeclarativeDebugEnginesQuery(); - QList engines() const; -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - QDeclarativeDebugEnginesQuery(QObject *); - QDeclarativeEngineDebug *m_client; - int m_queryId; - QList m_engines; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugRootContextQuery : public QDeclarativeDebugQuery -{ -Q_OBJECT -public: - virtual ~QDeclarativeDebugRootContextQuery(); - QDeclarativeDebugContextReference rootContext() const; -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - QDeclarativeDebugRootContextQuery(QObject *); - QDeclarativeEngineDebug *m_client; - int m_queryId; - QDeclarativeDebugContextReference m_context; -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectQuery : public QDeclarativeDebugQuery -{ -Q_OBJECT -public: - virtual ~QDeclarativeDebugObjectQuery(); - QDeclarativeDebugObjectReference object() const; -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - QDeclarativeDebugObjectQuery(QObject *); - QDeclarativeEngineDebug *m_client; - int m_queryId; - QDeclarativeDebugObjectReference m_object; - -}; - -class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugExpressionQuery : public QDeclarativeDebugQuery -{ -Q_OBJECT -public: - virtual ~QDeclarativeDebugExpressionQuery(); - QVariant expression() const; - QVariant result() const; -private: - friend class QDeclarativeEngineDebug; - friend class QDeclarativeEngineDebugPrivate; - QDeclarativeDebugExpressionQuery(QObject *); - QDeclarativeEngineDebug *m_client; - int m_queryId; - QVariant m_expr; - QVariant m_result; -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QDeclarativeDebugEngineReference) -Q_DECLARE_METATYPE(QDeclarativeDebugObjectReference) -Q_DECLARE_METATYPE(QDeclarativeDebugContextReference) -Q_DECLARE_METATYPE(QDeclarativeDebugPropertyReference) - -QT_END_HEADER - -#endif // QDECLARATIVEDEBUG_H diff --git a/src/declarative/debugger/qdeclarativeenginedebug.cpp b/src/declarative/debugger/qdeclarativeenginedebug.cpp new file mode 100644 index 0000000..85ce710 --- /dev/null +++ b/src/declarative/debugger/qdeclarativeenginedebug.cpp @@ -0,0 +1,1068 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "private/qdeclarativeenginedebug_p.h" + +#include "private/qdeclarativedebugclient_p.h" + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QDeclarativeEngineDebugClient : public QDeclarativeDebugClient +{ +public: + QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, QDeclarativeEngineDebugPrivate *p); + +protected: + virtual void statusChanged(Status status); + virtual void messageReceived(const QByteArray &); + +private: + QDeclarativeEngineDebugPrivate *priv; + friend class QDeclarativeEngineDebugPrivate; +}; + +class QDeclarativeEngineDebugPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QDeclarativeEngineDebug) +public: + QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *); + ~QDeclarativeEngineDebugPrivate(); + + void statusChanged(QDeclarativeEngineDebug::Status status); + void message(const QByteArray &); + + QDeclarativeEngineDebugClient *client; + int nextId; + int getId(); + + void decode(QDataStream &, QDeclarativeDebugContextReference &); + void decode(QDataStream &, QDeclarativeDebugObjectReference &, bool simple); + + static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugEnginesQuery *); + static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugRootContextQuery *); + static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugObjectQuery *); + static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugExpressionQuery *); + static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugWatch *); + + QHash enginesQuery; + QHash rootContextQuery; + QHash objectQuery; + QHash expressionQuery; + + QHash watched; +}; + +QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, + QDeclarativeEngineDebugPrivate *p) +: QDeclarativeDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p) +{ +} + +void QDeclarativeEngineDebugClient::statusChanged(Status status) +{ + if (priv) + priv->statusChanged(static_cast(status)); +} + +void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data) +{ + if (priv) + priv->message(data); +} + +QDeclarativeEngineDebugPrivate::QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *c) +: client(new QDeclarativeEngineDebugClient(c, this)), nextId(0) +{ +} + +QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate() +{ + if (client) + client->priv = 0; + delete client; + + QHash::iterator enginesIter = enginesQuery.begin(); + for (; enginesIter != enginesQuery.end(); ++enginesIter) { + enginesIter.value()->m_client = 0; + if (enginesIter.value()->state() == QDeclarativeDebugQuery::Waiting) + enginesIter.value()->setState(QDeclarativeDebugQuery::Error); + } + + QHash::iterator rootContextIter = rootContextQuery.begin(); + for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) { + rootContextIter.value()->m_client = 0; + if (rootContextIter.value()->state() == QDeclarativeDebugQuery::Waiting) + rootContextIter.value()->setState(QDeclarativeDebugQuery::Error); + } + + QHash::iterator objectIter = objectQuery.begin(); + for (; objectIter != objectQuery.end(); ++objectIter) { + objectIter.value()->m_client = 0; + if (objectIter.value()->state() == QDeclarativeDebugQuery::Waiting) + objectIter.value()->setState(QDeclarativeDebugQuery::Error); + } + + QHash::iterator exprIter = expressionQuery.begin(); + for (; exprIter != expressionQuery.end(); ++exprIter) { + exprIter.value()->m_client = 0; + if (exprIter.value()->state() == QDeclarativeDebugQuery::Waiting) + exprIter.value()->setState(QDeclarativeDebugQuery::Error); + } + + QHash::iterator watchIter = watched.begin(); + for (; watchIter != watched.end(); ++watchIter) { + watchIter.value()->m_client = 0; + watchIter.value()->setState(QDeclarativeDebugWatch::Dead); + } +} + +int QDeclarativeEngineDebugPrivate::getId() +{ + return nextId++; +} + +void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugEnginesQuery *q) +{ + if (c && q) { + QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); + p->enginesQuery.remove(q->m_queryId); + } +} + +void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, + QDeclarativeDebugRootContextQuery *q) +{ + if (c && q) { + QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); + p->rootContextQuery.remove(q->m_queryId); + } +} + +void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugObjectQuery *q) +{ + if (c && q) { + QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); + p->objectQuery.remove(q->m_queryId); + } +} + +void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugExpressionQuery *q) +{ + if (c && q) { + QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); + p->expressionQuery.remove(q->m_queryId); + } +} + +void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugWatch *w) +{ + if (c && w) { + QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c); + p->watched.remove(w->m_queryId); + } +} + +void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o, + bool simple) +{ + QDeclarativeEngineDebugService::QDeclarativeObjectData data; + ds >> data; + o.m_debugId = data.objectId; + o.m_class = data.objectType; + o.m_idString = data.idString; + o.m_name = data.objectName; + o.m_source.m_url = data.url; + o.m_source.m_lineNumber = data.lineNumber; + o.m_source.m_columnNumber = data.columnNumber; + o.m_contextDebugId = data.contextId; + + if (simple) + return; + + int childCount; + bool recur; + ds >> childCount >> recur; + + for (int ii = 0; ii < childCount; ++ii) { + o.m_children.append(QDeclarativeDebugObjectReference()); + decode(ds, o.m_children.last(), !recur); + } + + int propCount; + ds >> propCount; + + for (int ii = 0; ii < propCount; ++ii) { + QDeclarativeEngineDebugService::QDeclarativeObjectProperty data; + ds >> data; + QDeclarativeDebugPropertyReference prop; + prop.m_objectDebugId = o.m_debugId; + prop.m_name = data.name; + prop.m_binding = data.binding; + prop.m_hasNotifySignal = data.hasNotifySignal; + prop.m_valueTypeName = data.valueTypeName; + switch (data.type) { + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic: + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List: + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty: + { + prop.m_value = data.value; + break; + } + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object: + { + QDeclarativeDebugObjectReference obj; + obj.m_debugId = prop.m_value.toInt(); + prop.m_value = QVariant::fromValue(obj); + break; + } + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown: + break; + } + o.m_properties << prop; + } +} + +void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugContextReference &c) +{ + ds >> c.m_name >> c.m_debugId; + + int contextCount; + ds >> contextCount; + + for (int ii = 0; ii < contextCount; ++ii) { + c.m_contexts.append(QDeclarativeDebugContextReference()); + decode(ds, c.m_contexts.last()); + } + + int objectCount; + ds >> objectCount; + + for (int ii = 0; ii < objectCount; ++ii) { + QDeclarativeDebugObjectReference obj; + decode(ds, obj, true); + + obj.m_contextDebugId = c.m_debugId; + c.m_objects << obj; + } +} + +void QDeclarativeEngineDebugPrivate::statusChanged(QDeclarativeEngineDebug::Status status) +{ + emit q_func()->statusChanged(status); +} + +void QDeclarativeEngineDebugPrivate::message(const QByteArray &data) +{ + QDataStream ds(data); + + QByteArray type; + ds >> type; + + //qDebug() << "QDeclarativeEngineDebugPrivate::message()" << type; + + if (type == "LIST_ENGINES_R") { + int queryId; + ds >> queryId; + + QDeclarativeDebugEnginesQuery *query = enginesQuery.value(queryId); + if (!query) + return; + enginesQuery.remove(queryId); + + int count; + ds >> count; + + for (int ii = 0; ii < count; ++ii) { + QDeclarativeDebugEngineReference ref; + ds >> ref.m_name; + ds >> ref.m_debugId; + query->m_engines << ref; + } + + query->m_client = 0; + query->setState(QDeclarativeDebugQuery::Completed); + } else if (type == "LIST_OBJECTS_R") { + int queryId; + ds >> queryId; + + QDeclarativeDebugRootContextQuery *query = rootContextQuery.value(queryId); + if (!query) + return; + rootContextQuery.remove(queryId); + + if (!ds.atEnd()) + decode(ds, query->m_context); + + query->m_client = 0; + query->setState(QDeclarativeDebugQuery::Completed); + } else if (type == "FETCH_OBJECT_R") { + int queryId; + ds >> queryId; + + QDeclarativeDebugObjectQuery *query = objectQuery.value(queryId); + if (!query) + return; + objectQuery.remove(queryId); + + if (!ds.atEnd()) + decode(ds, query->m_object, false); + + query->m_client = 0; + query->setState(QDeclarativeDebugQuery::Completed); + } else if (type == "EVAL_EXPRESSION_R") { + int queryId; + QVariant result; + ds >> queryId >> result; + + QDeclarativeDebugExpressionQuery *query = expressionQuery.value(queryId); + if (!query) + return; + expressionQuery.remove(queryId); + + query->m_result = result; + query->m_client = 0; + query->setState(QDeclarativeDebugQuery::Completed); + } else if (type == "WATCH_PROPERTY_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QDeclarativeDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); + } else if (type == "WATCH_OBJECT_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QDeclarativeDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); + } else if (type == "WATCH_EXPR_OBJECT_R") { + int queryId; + bool ok; + ds >> queryId >> ok; + + QDeclarativeDebugWatch *watch = watched.value(queryId); + if (!watch) + return; + + watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive); + } else if (type == "UPDATE_WATCH") { + int queryId; + int debugId; + QByteArray name; + QVariant value; + ds >> queryId >> debugId >> name >> value; + + QDeclarativeDebugWatch *watch = watched.value(queryId, 0); + if (!watch) + return; + emit watch->valueChanged(name, value); + } else if (type == "OBJECT_CREATED") { + emit q_func()->newObjects(); + } +} + +QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent) +: QObject(*(new QDeclarativeEngineDebugPrivate(client)), parent) +{ +} + +QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const +{ + Q_D(const QDeclarativeEngineDebug); + + return static_cast(d->client->status()); +} + +QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + + QDeclarativeDebugPropertyWatch *watch = new QDeclarativeDebugPropertyWatch(parent); + if (d->client->status() == QDeclarativeDebugClient::Enabled) { + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_client = this; + watch->m_objectDebugId = property.objectDebugId(); + watch->m_name = property.name(); + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8(); + d->client->sendMessage(message); + } else { + watch->m_state = QDeclarativeDebugWatch::Dead; + } + + return watch; +} + +QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugContextReference &, const QString &, QObject *) +{ + qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented"); + return 0; +} + +QDeclarativeDebugObjectExpressionWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, const QString &expr, QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + QDeclarativeDebugObjectExpressionWatch *watch = new QDeclarativeDebugObjectExpressionWatch(parent); + if (d->client->status() == QDeclarativeDebugClient::Enabled) { + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_client = this; + watch->m_objectDebugId = object.debugId(); + watch->m_expr = expr; + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr; + d->client->sendMessage(message); + } else { + watch->m_state = QDeclarativeDebugWatch::Dead; + } + return watch; +} + +QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + + QDeclarativeDebugWatch *watch = new QDeclarativeDebugWatch(parent); + if (d->client->status() == QDeclarativeDebugClient::Enabled) { + int queryId = d->getId(); + watch->m_queryId = queryId; + watch->m_client = this; + watch->m_objectDebugId = object.debugId(); + d->watched.insert(queryId, watch); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId(); + d->client->sendMessage(message); + } else { + watch->m_state = QDeclarativeDebugWatch::Dead; + } + + return watch; +} + +QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugFileReference &, QObject *) +{ + qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented"); + return 0; +} + +void QDeclarativeEngineDebug::removeWatch(QDeclarativeDebugWatch *watch) +{ + Q_D(QDeclarativeEngineDebug); + + if (!watch || !watch->m_client) + return; + + watch->m_client = 0; + watch->setState(QDeclarativeDebugWatch::Inactive); + + d->watched.remove(watch->queryId()); + + if (d->client && d->client->status() == QDeclarativeDebugClient::Enabled) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("NO_WATCH") << watch->queryId(); + d->client->sendMessage(message); + } +} + +QDeclarativeDebugEnginesQuery *QDeclarativeEngineDebug::queryAvailableEngines(QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + + QDeclarativeDebugEnginesQuery *query = new QDeclarativeDebugEnginesQuery(parent); + if (d->client->status() == QDeclarativeDebugClient::Enabled) { + query->m_client = this; + int queryId = d->getId(); + query->m_queryId = queryId; + d->enginesQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("LIST_ENGINES") << queryId; + d->client->sendMessage(message); + } else { + query->m_state = QDeclarativeDebugQuery::Error; + } + + return query; +} + +QDeclarativeDebugRootContextQuery *QDeclarativeEngineDebug::queryRootContexts(const QDeclarativeDebugEngineReference &engine, QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + + QDeclarativeDebugRootContextQuery *query = new QDeclarativeDebugRootContextQuery(parent); + if (d->client->status() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) { + query->m_client = this; + int queryId = d->getId(); + query->m_queryId = queryId; + d->rootContextQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId(); + d->client->sendMessage(message); + } else { + query->m_state = QDeclarativeDebugQuery::Error; + } + + return query; +} + +QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObject(const QDeclarativeDebugObjectReference &object, QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + + QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent); + if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) { + query->m_client = this; + int queryId = d->getId(); + query->m_queryId = queryId; + d->objectQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId() + << false << true; + d->client->sendMessage(message); + } else { + query->m_state = QDeclarativeDebugQuery::Error; + } + + return query; +} + +QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObjectRecursive(const QDeclarativeDebugObjectReference &object, QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + + QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent); + if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) { + query->m_client = this; + int queryId = d->getId(); + query->m_queryId = queryId; + d->objectQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId() + << true << true; + d->client->sendMessage(message); + } else { + query->m_state = QDeclarativeDebugQuery::Error; + } + + return query; +} + +QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + + QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent); + if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { + query->m_client = this; + query->m_expr = expr; + int queryId = d->getId(); + query->m_queryId = queryId; + d->expressionQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr; + d->client->sendMessage(message); + } else { + query->m_state = QDeclarativeDebugQuery::Error; + } + + return query; +} + +bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName, + const QVariant &bindingExpression, + bool isLiteralValue, + QString source, int line) +{ + Q_D(QDeclarativeEngineDebug); + + if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line; + d->client->sendMessage(message); + return true; + } else { + return false; + } +} + +bool QDeclarativeEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName) +{ + Q_D(QDeclarativeEngineDebug); + + if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName; + d->client->sendMessage(message); + return true; + } else { + return false; + } +} + +bool QDeclarativeEngineDebug::setMethodBody(int objectDebugId, const QString &methodName, + const QString &methodBody) +{ + Q_D(QDeclarativeEngineDebug); + + if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody; + d->client->sendMessage(message); + return true; + } else { + return false; + } +} + +QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent) +: QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1) +{ +} + +QDeclarativeDebugWatch::~QDeclarativeDebugWatch() +{ + if (m_client && m_queryId != -1) + QDeclarativeEngineDebugPrivate::remove(m_client, this); +} + +int QDeclarativeDebugWatch::queryId() const +{ + return m_queryId; +} + +int QDeclarativeDebugWatch::objectDebugId() const +{ + return m_objectDebugId; +} + +QDeclarativeDebugWatch::State QDeclarativeDebugWatch::state() const +{ + return m_state; +} + +void QDeclarativeDebugWatch::setState(State s) +{ + if (m_state == s) + return; + m_state = s; + emit stateChanged(m_state); +} + +QDeclarativeDebugPropertyWatch::QDeclarativeDebugPropertyWatch(QObject *parent) + : QDeclarativeDebugWatch(parent) +{ +} + +QString QDeclarativeDebugPropertyWatch::name() const +{ + return m_name; +} + + +QDeclarativeDebugObjectExpressionWatch::QDeclarativeDebugObjectExpressionWatch(QObject *parent) + : QDeclarativeDebugWatch(parent) +{ +} + +QString QDeclarativeDebugObjectExpressionWatch::expression() const +{ + return m_expr; +} + + +QDeclarativeDebugQuery::QDeclarativeDebugQuery(QObject *parent) +: QObject(parent), m_state(Waiting) +{ +} + +QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state() const +{ + return m_state; +} + +bool QDeclarativeDebugQuery::isWaiting() const +{ + return m_state == Waiting; +} + +void QDeclarativeDebugQuery::setState(State s) +{ + if (m_state == s) + return; + m_state = s; + emit stateChanged(m_state); +} + +QDeclarativeDebugEnginesQuery::QDeclarativeDebugEnginesQuery(QObject *parent) +: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) +{ +} + +QDeclarativeDebugEnginesQuery::~QDeclarativeDebugEnginesQuery() +{ + if (m_client && m_queryId != -1) + QDeclarativeEngineDebugPrivate::remove(m_client, this); +} + +QList QDeclarativeDebugEnginesQuery::engines() const +{ + return m_engines; +} + +QDeclarativeDebugRootContextQuery::QDeclarativeDebugRootContextQuery(QObject *parent) +: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) +{ +} + +QDeclarativeDebugRootContextQuery::~QDeclarativeDebugRootContextQuery() +{ + if (m_client && m_queryId != -1) + QDeclarativeEngineDebugPrivate::remove(m_client, this); +} + +QDeclarativeDebugContextReference QDeclarativeDebugRootContextQuery::rootContext() const +{ + return m_context; +} + +QDeclarativeDebugObjectQuery::QDeclarativeDebugObjectQuery(QObject *parent) +: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) +{ +} + +QDeclarativeDebugObjectQuery::~QDeclarativeDebugObjectQuery() +{ + if (m_client && m_queryId != -1) + QDeclarativeEngineDebugPrivate::remove(m_client, this); +} + +QDeclarativeDebugObjectReference QDeclarativeDebugObjectQuery::object() const +{ + return m_object; +} + +QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(QObject *parent) +: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1) +{ +} + +QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery() +{ + if (m_client && m_queryId != -1) + QDeclarativeEngineDebugPrivate::remove(m_client, this); +} + +QVariant QDeclarativeDebugExpressionQuery::expression() const +{ + return m_expr; +} + +QVariant QDeclarativeDebugExpressionQuery::result() const +{ + return m_result; +} + +QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference() +: m_debugId(-1) +{ +} + +QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(int debugId) +: m_debugId(debugId) +{ +} + +QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &o) +: m_debugId(o.m_debugId), m_name(o.m_name) +{ +} + +QDeclarativeDebugEngineReference & +QDeclarativeDebugEngineReference::operator=(const QDeclarativeDebugEngineReference &o) +{ + m_debugId = o.m_debugId; m_name = o.m_name; + return *this; +} + +int QDeclarativeDebugEngineReference::debugId() const +{ + return m_debugId; +} + +QString QDeclarativeDebugEngineReference::name() const +{ + return m_name; +} + +QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference() +: m_debugId(-1), m_contextDebugId(-1) +{ +} + +QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(int debugId) +: m_debugId(debugId), m_contextDebugId(-1) +{ +} + +QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &o) +: m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString), + m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId), + m_properties(o.m_properties), m_children(o.m_children) +{ +} + +QDeclarativeDebugObjectReference & +QDeclarativeDebugObjectReference::operator=(const QDeclarativeDebugObjectReference &o) +{ + m_debugId = o.m_debugId; m_class = o.m_class; m_idString = o.m_idString; + m_name = o.m_name; m_source = o.m_source; m_contextDebugId = o.m_contextDebugId; + m_properties = o.m_properties; m_children = o.m_children; + return *this; +} + +int QDeclarativeDebugObjectReference::debugId() const +{ + return m_debugId; +} + +QString QDeclarativeDebugObjectReference::className() const +{ + return m_class; +} + +QString QDeclarativeDebugObjectReference::idString() const +{ + return m_idString; +} + +QString QDeclarativeDebugObjectReference::name() const +{ + return m_name; +} + +QDeclarativeDebugFileReference QDeclarativeDebugObjectReference::source() const +{ + return m_source; +} + +int QDeclarativeDebugObjectReference::contextDebugId() const +{ + return m_contextDebugId; +} + +QList QDeclarativeDebugObjectReference::properties() const +{ + return m_properties; +} + +QList QDeclarativeDebugObjectReference::children() const +{ + return m_children; +} + +QDeclarativeDebugContextReference::QDeclarativeDebugContextReference() +: m_debugId(-1) +{ +} + +QDeclarativeDebugContextReference::QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &o) +: m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts) +{ +} + +QDeclarativeDebugContextReference &QDeclarativeDebugContextReference::operator=(const QDeclarativeDebugContextReference &o) +{ + m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects; + m_contexts = o.m_contexts; + return *this; +} + +int QDeclarativeDebugContextReference::debugId() const +{ + return m_debugId; +} + +QString QDeclarativeDebugContextReference::name() const +{ + return m_name; +} + +QList QDeclarativeDebugContextReference::objects() const +{ + return m_objects; +} + +QList QDeclarativeDebugContextReference::contexts() const +{ + return m_contexts; +} + +QDeclarativeDebugFileReference::QDeclarativeDebugFileReference() +: m_lineNumber(-1), m_columnNumber(-1) +{ +} + +QDeclarativeDebugFileReference::QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &o) +: m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber) +{ +} + +QDeclarativeDebugFileReference &QDeclarativeDebugFileReference::operator=(const QDeclarativeDebugFileReference &o) +{ + m_url = o.m_url; m_lineNumber = o.m_lineNumber; m_columnNumber = o.m_columnNumber; + return *this; +} + +QUrl QDeclarativeDebugFileReference::url() const +{ + return m_url; +} + +void QDeclarativeDebugFileReference::setUrl(const QUrl &u) +{ + m_url = u; +} + +int QDeclarativeDebugFileReference::lineNumber() const +{ + return m_lineNumber; +} + +void QDeclarativeDebugFileReference::setLineNumber(int l) +{ + m_lineNumber = l; +} + +int QDeclarativeDebugFileReference::columnNumber() const +{ + return m_columnNumber; +} + +void QDeclarativeDebugFileReference::setColumnNumber(int c) +{ + m_columnNumber = c; +} + +QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference() +: m_objectDebugId(-1), m_hasNotifySignal(false) +{ +} + +QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &o) +: m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value), + m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding), + m_hasNotifySignal(o.m_hasNotifySignal) +{ +} + +QDeclarativeDebugPropertyReference &QDeclarativeDebugPropertyReference::operator=(const QDeclarativeDebugPropertyReference &o) +{ + m_objectDebugId = o.m_objectDebugId; m_name = o.m_name; m_value = o.m_value; + m_valueTypeName = o.m_valueTypeName; m_binding = o.m_binding; + m_hasNotifySignal = o.m_hasNotifySignal; + return *this; +} + +int QDeclarativeDebugPropertyReference::objectDebugId() const +{ + return m_objectDebugId; +} + +QString QDeclarativeDebugPropertyReference::name() const +{ + return m_name; +} + +QString QDeclarativeDebugPropertyReference::valueTypeName() const +{ + return m_valueTypeName; +} + +QVariant QDeclarativeDebugPropertyReference::value() const +{ + return m_value; +} + +QString QDeclarativeDebugPropertyReference::binding() const +{ + return m_binding; +} + +bool QDeclarativeDebugPropertyReference::hasNotifySignal() const +{ + return m_hasNotifySignal; +} + +QT_END_NAMESPACE + diff --git a/src/declarative/debugger/qdeclarativeenginedebug_p.h b/src/declarative/debugger/qdeclarativeenginedebug_p.h new file mode 100644 index 0000000..9b70e1c --- /dev/null +++ b/src/declarative/debugger/qdeclarativeenginedebug_p.h @@ -0,0 +1,387 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QDECLARATIVEENGINEDEBUG_H +#define QDECLARATIVEENGINEDEBUG_H + +#include +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeDebugConnection; +class QDeclarativeDebugWatch; +class QDeclarativeDebugPropertyWatch; +class QDeclarativeDebugObjectExpressionWatch; +class QDeclarativeDebugEnginesQuery; +class QDeclarativeDebugRootContextQuery; +class QDeclarativeDebugObjectQuery; +class QDeclarativeDebugExpressionQuery; +class QDeclarativeDebugPropertyReference; +class QDeclarativeDebugContextReference; +class QDeclarativeDebugObjectReference; +class QDeclarativeDebugFileReference; +class QDeclarativeDebugEngineReference; +class QDeclarativeEngineDebugPrivate; +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEngineDebug : public QObject +{ +Q_OBJECT +public: + enum Status { NotConnected, Unavailable, Enabled }; + + explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0); + + Status status() const; + + QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &, + QObject *parent = 0); + QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugContextReference &, const QString &, + QObject *parent = 0); + QDeclarativeDebugObjectExpressionWatch *addWatch(const QDeclarativeDebugObjectReference &, const QString &, + QObject *parent = 0); + QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugObjectReference &, + QObject *parent = 0); + QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugFileReference &, + QObject *parent = 0); + + void removeWatch(QDeclarativeDebugWatch *watch); + + QDeclarativeDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0); + QDeclarativeDebugRootContextQuery *queryRootContexts(const QDeclarativeDebugEngineReference &, + QObject *parent = 0); + QDeclarativeDebugObjectQuery *queryObject(const QDeclarativeDebugObjectReference &, + QObject *parent = 0); + QDeclarativeDebugObjectQuery *queryObjectRecursive(const QDeclarativeDebugObjectReference &, + QObject *parent = 0); + QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId, + const QString &expr, + QObject *parent = 0); + bool setBindingForObject(int objectDebugId, const QString &propertyName, + const QVariant &bindingExpression, bool isLiteralValue, + QString source = QString(), int line = -1); + bool resetBindingForObject(int objectDebugId, const QString &propertyName); + bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody); + +Q_SIGNALS: + void newObjects(); + void statusChanged(Status status); + +private: + Q_DECLARE_PRIVATE(QDeclarativeEngineDebug) +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugWatch : public QObject +{ +Q_OBJECT +public: + enum State { Waiting, Active, Inactive, Dead }; + + QDeclarativeDebugWatch(QObject *); + ~QDeclarativeDebugWatch(); + + int queryId() const; + int objectDebugId() const; + State state() const; + +Q_SIGNALS: + void stateChanged(QDeclarativeDebugWatch::State); + //void objectChanged(int, const QDeclarativeDebugObjectReference &); + //void valueChanged(int, const QVariant &); + + // Server sends value as string if it is a user-type variant + void valueChanged(const QByteArray &name, const QVariant &value); + +private: + friend class QDeclarativeEngineDebug; + friend class QDeclarativeEngineDebugPrivate; + void setState(State); + State m_state; + int m_queryId; + QDeclarativeEngineDebug *m_client; + int m_objectDebugId; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugPropertyWatch : public QDeclarativeDebugWatch +{ + Q_OBJECT +public: + QDeclarativeDebugPropertyWatch(QObject *parent); + + QString name() const; + +private: + friend class QDeclarativeEngineDebug; + QString m_name; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectExpressionWatch : public QDeclarativeDebugWatch +{ + Q_OBJECT +public: + QDeclarativeDebugObjectExpressionWatch(QObject *parent); + + QString expression() const; + +private: + friend class QDeclarativeEngineDebug; + QString m_expr; + int m_debugId; +}; + + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugQuery : public QObject +{ +Q_OBJECT +public: + enum State { Waiting, Error, Completed }; + + State state() const; + bool isWaiting() const; + +// bool waitUntilCompleted(); + +Q_SIGNALS: + void stateChanged(QDeclarativeDebugQuery::State); + +protected: + QDeclarativeDebugQuery(QObject *); + +private: + friend class QDeclarativeEngineDebug; + friend class QDeclarativeEngineDebugPrivate; + void setState(State); + State m_state; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugFileReference +{ +public: + QDeclarativeDebugFileReference(); + QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &); + QDeclarativeDebugFileReference &operator=(const QDeclarativeDebugFileReference &); + + QUrl url() const; + void setUrl(const QUrl &); + int lineNumber() const; + void setLineNumber(int); + int columnNumber() const; + void setColumnNumber(int); + +private: + friend class QDeclarativeEngineDebugPrivate; + QUrl m_url; + int m_lineNumber; + int m_columnNumber; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEngineReference +{ +public: + QDeclarativeDebugEngineReference(); + QDeclarativeDebugEngineReference(int); + QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &); + QDeclarativeDebugEngineReference &operator=(const QDeclarativeDebugEngineReference &); + + int debugId() const; + QString name() const; + +private: + friend class QDeclarativeEngineDebugPrivate; + int m_debugId; + QString m_name; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectReference +{ +public: + QDeclarativeDebugObjectReference(); + QDeclarativeDebugObjectReference(int); + QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &); + QDeclarativeDebugObjectReference &operator=(const QDeclarativeDebugObjectReference &); + + int debugId() const; + QString className() const; + QString idString() const; + QString name() const; + + QDeclarativeDebugFileReference source() const; + int contextDebugId() const; + + QList properties() const; + QList children() const; + +private: + friend class QDeclarativeEngineDebugPrivate; + int m_debugId; + QString m_class; + QString m_idString; + QString m_name; + QDeclarativeDebugFileReference m_source; + int m_contextDebugId; + QList m_properties; + QList m_children; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugContextReference +{ +public: + QDeclarativeDebugContextReference(); + QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &); + QDeclarativeDebugContextReference &operator=(const QDeclarativeDebugContextReference &); + + int debugId() const; + QString name() const; + + QList objects() const; + QList contexts() const; + +private: + friend class QDeclarativeEngineDebugPrivate; + int m_debugId; + QString m_name; + QList m_objects; + QList m_contexts; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugPropertyReference +{ +public: + QDeclarativeDebugPropertyReference(); + QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &); + QDeclarativeDebugPropertyReference &operator=(const QDeclarativeDebugPropertyReference &); + + int objectDebugId() const; + QString name() const; + QVariant value() const; + QString valueTypeName() const; + QString binding() const; + bool hasNotifySignal() const; + +private: + friend class QDeclarativeEngineDebugPrivate; + int m_objectDebugId; + QString m_name; + QVariant m_value; + QString m_valueTypeName; + QString m_binding; + bool m_hasNotifySignal; +}; + + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEnginesQuery : public QDeclarativeDebugQuery +{ +Q_OBJECT +public: + virtual ~QDeclarativeDebugEnginesQuery(); + QList engines() const; +private: + friend class QDeclarativeEngineDebug; + friend class QDeclarativeEngineDebugPrivate; + QDeclarativeDebugEnginesQuery(QObject *); + QDeclarativeEngineDebug *m_client; + int m_queryId; + QList m_engines; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugRootContextQuery : public QDeclarativeDebugQuery +{ +Q_OBJECT +public: + virtual ~QDeclarativeDebugRootContextQuery(); + QDeclarativeDebugContextReference rootContext() const; +private: + friend class QDeclarativeEngineDebug; + friend class QDeclarativeEngineDebugPrivate; + QDeclarativeDebugRootContextQuery(QObject *); + QDeclarativeEngineDebug *m_client; + int m_queryId; + QDeclarativeDebugContextReference m_context; +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectQuery : public QDeclarativeDebugQuery +{ +Q_OBJECT +public: + virtual ~QDeclarativeDebugObjectQuery(); + QDeclarativeDebugObjectReference object() const; +private: + friend class QDeclarativeEngineDebug; + friend class QDeclarativeEngineDebugPrivate; + QDeclarativeDebugObjectQuery(QObject *); + QDeclarativeEngineDebug *m_client; + int m_queryId; + QDeclarativeDebugObjectReference m_object; + +}; + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugExpressionQuery : public QDeclarativeDebugQuery +{ +Q_OBJECT +public: + virtual ~QDeclarativeDebugExpressionQuery(); + QVariant expression() const; + QVariant result() const; +private: + friend class QDeclarativeEngineDebug; + friend class QDeclarativeEngineDebugPrivate; + QDeclarativeDebugExpressionQuery(QObject *); + QDeclarativeEngineDebug *m_client; + int m_queryId; + QVariant m_expr; + QVariant m_result; +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QDeclarativeDebugEngineReference) +Q_DECLARE_METATYPE(QDeclarativeDebugObjectReference) +Q_DECLARE_METATYPE(QDeclarativeDebugContextReference) +Q_DECLARE_METATYPE(QDeclarativeDebugPropertyReference) + +QT_END_HEADER + +#endif // QDECLARATIVEENGINEDEBUG_H diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 632c404..f4170ea 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index ea7104f..4148687 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -47,9 +47,6 @@ #include -#include -#include - #include "../../../shared/util.h" #include "../shared/debugutil_p.h" diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index 286b258..d849ad2 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -47,7 +47,6 @@ #include -#include #include #include -- 1.7.2.5