forked from qt-creator/qt-creator
QmlDebugger: Also show status of QDeclarativeEngine client in log
Fix QDeclarativeEngineDebug to use the same enum as the other clients. Also, use objectName() to name the clients. Change-Id: I826970bf248ce2f50c4bf66c1f58c0b9b56698b1 Reviewed-on: http://codereview.qt-project.org/5231 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
||||
QDeclarativeEngineDebugPrivate(QDeclarativeEngineDebug *, QDeclarativeDebugConnection *);
|
||||
~QDeclarativeEngineDebugPrivate();
|
||||
|
||||
void statusChanged(QDeclarativeEngineDebug::Status status);
|
||||
void statusChanged(QDeclarativeDebugClient::Status status);
|
||||
void message(const QByteArray &);
|
||||
|
||||
QDeclarativeEngineDebugClient *client;
|
||||
@@ -90,7 +90,7 @@ QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugCo
|
||||
void QDeclarativeEngineDebugClient::statusChanged(Status status)
|
||||
{
|
||||
if (priv)
|
||||
priv->statusChanged(static_cast<QDeclarativeEngineDebug::Status>(status));
|
||||
priv->statusChanged(status);
|
||||
}
|
||||
|
||||
void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data)
|
||||
@@ -313,7 +313,7 @@ void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugCo
|
||||
}
|
||||
}
|
||||
|
||||
void QDeclarativeEngineDebugPrivate::statusChanged(QDeclarativeEngineDebug::Status status)
|
||||
void QDeclarativeEngineDebugPrivate::statusChanged(QDeclarativeDebugClient::Status status)
|
||||
{
|
||||
emit q_ptr->statusChanged(status);
|
||||
}
|
||||
@@ -438,17 +438,18 @@ void QDeclarativeEngineDebugPrivate::message(const QByteArray &data)
|
||||
QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent)
|
||||
: QObject(parent), d_ptr(new QDeclarativeEngineDebugPrivate(this, client))
|
||||
{
|
||||
setObjectName(d_ptr->client->name());
|
||||
}
|
||||
|
||||
QDeclarativeEngineDebug::~QDeclarativeEngineDebug()
|
||||
{
|
||||
}
|
||||
|
||||
QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const
|
||||
QDeclarativeDebugClient::Status QDeclarativeEngineDebug::status() const
|
||||
{
|
||||
Q_D(const QDeclarativeEngineDebug);
|
||||
|
||||
return static_cast<QDeclarativeEngineDebug::Status>(d->client->status());
|
||||
return d->client->status();
|
||||
}
|
||||
|
||||
QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent)
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#define QDECLARATIVEENGINEDEBUG_H
|
||||
|
||||
#include "qmljsdebugclient_global.h"
|
||||
#include "qdeclarativedebugclient.h"
|
||||
#include <QtCore/qobject.h>
|
||||
#include <QtCore/qurl.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
@@ -58,12 +59,10 @@ class QMLJSDEBUGCLIENT_EXPORT QDeclarativeEngineDebug : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Status { NotConnected, Unavailable, Enabled };
|
||||
|
||||
explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0);
|
||||
~QDeclarativeEngineDebug();
|
||||
|
||||
Status status() const;
|
||||
QDeclarativeDebugClient::Status status() const;
|
||||
|
||||
QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &,
|
||||
QObject *parent = 0);
|
||||
@@ -96,7 +95,7 @@ public:
|
||||
|
||||
Q_SIGNALS:
|
||||
void newObjects();
|
||||
void statusChanged(Status status);
|
||||
void statusChanged(QDeclarativeDebugClient::Status status);
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QDeclarativeEngineDebug)
|
||||
|
||||
@@ -68,6 +68,8 @@ void ClientProxy::connectToServer()
|
||||
m_engineClient = new QDeclarativeEngineDebug(m_adapter.data()->connection(), this);
|
||||
|
||||
connect(m_engineClient, SIGNAL(newObjects()), this, SLOT(newObjects()));
|
||||
connect(m_engineClient, SIGNAL(statusChanged(QDeclarativeDebugClient::Status)),
|
||||
this, SLOT(clientStatusChanged(QDeclarativeDebugClient::Status)));
|
||||
|
||||
m_inspectorClient = new QmlJSInspectorClient(m_adapter.data()->connection(), this);
|
||||
|
||||
@@ -104,8 +106,8 @@ void ClientProxy::connectToServer()
|
||||
void ClientProxy::clientStatusChanged(QDeclarativeDebugClient::Status status)
|
||||
{
|
||||
QString serviceName;
|
||||
if (QDeclarativeDebugClient *client = qobject_cast<QDeclarativeDebugClient*>(sender())) {
|
||||
serviceName = client->name();
|
||||
if (sender()) {
|
||||
serviceName = sender()->objectName();
|
||||
}
|
||||
|
||||
if (m_adapter)
|
||||
@@ -613,7 +615,7 @@ void ClientProxy::reparentQmlObject(int debugId, int newParent)
|
||||
void ClientProxy::updateConnected()
|
||||
{
|
||||
bool isConnected = m_inspectorClient && m_inspectorClient->status() == QDeclarativeDebugClient::Enabled
|
||||
&& m_engineClient && m_engineClient->status() == QDeclarativeEngineDebug::Enabled;
|
||||
&& m_engineClient && m_engineClient->status() == QDeclarativeDebugClient::Enabled;
|
||||
|
||||
if (isConnected != m_isConnected) {
|
||||
m_isConnected = isConnected;
|
||||
|
||||
@@ -45,6 +45,7 @@ QmlJSInspectorClient::QmlJSInspectorClient(QDeclarativeDebugConnection *client,
|
||||
: QDeclarativeDebugClient(QLatin1String("QDeclarativeObserverMode"), client) ,
|
||||
m_connection(client)
|
||||
{
|
||||
setObjectName(name());
|
||||
}
|
||||
|
||||
void QmlJSInspectorClient::statusChanged(Status status)
|
||||
|
||||
Reference in New Issue
Block a user