Commit 06a2a46f authored by Kai Koehne's avatar Kai Koehne
Browse files

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: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarAurindam Jana <aurindam.jana@nokia.com>
parent c412abf2
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
QDeclarativeEngineDebugPrivate(QDeclarativeEngineDebug *, QDeclarativeDebugConnection *); QDeclarativeEngineDebugPrivate(QDeclarativeEngineDebug *, QDeclarativeDebugConnection *);
~QDeclarativeEngineDebugPrivate(); ~QDeclarativeEngineDebugPrivate();
void statusChanged(QDeclarativeEngineDebug::Status status); void statusChanged(QDeclarativeDebugClient::Status status);
void message(const QByteArray &); void message(const QByteArray &);
QDeclarativeEngineDebugClient *client; QDeclarativeEngineDebugClient *client;
...@@ -90,7 +90,7 @@ QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugCo ...@@ -90,7 +90,7 @@ QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugCo
void QDeclarativeEngineDebugClient::statusChanged(Status status) void QDeclarativeEngineDebugClient::statusChanged(Status status)
{ {
if (priv) if (priv)
priv->statusChanged(static_cast<QDeclarativeEngineDebug::Status>(status)); priv->statusChanged(status);
} }
void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data) void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data)
...@@ -313,7 +313,7 @@ void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugCo ...@@ -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); emit q_ptr->statusChanged(status);
} }
...@@ -438,17 +438,18 @@ void QDeclarativeEngineDebugPrivate::message(const QByteArray &data) ...@@ -438,17 +438,18 @@ void QDeclarativeEngineDebugPrivate::message(const QByteArray &data)
QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent) QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent)
: QObject(parent), d_ptr(new QDeclarativeEngineDebugPrivate(this, client)) : QObject(parent), d_ptr(new QDeclarativeEngineDebugPrivate(this, client))
{ {
setObjectName(d_ptr->client->name());
} }
QDeclarativeEngineDebug::~QDeclarativeEngineDebug() QDeclarativeEngineDebug::~QDeclarativeEngineDebug()
{ {
} }
QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const QDeclarativeDebugClient::Status QDeclarativeEngineDebug::status() const
{ {
Q_D(const QDeclarativeEngineDebug); Q_D(const QDeclarativeEngineDebug);
return static_cast<QDeclarativeEngineDebug::Status>(d->client->status()); return d->client->status();
} }
QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent) QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent)
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define QDECLARATIVEENGINEDEBUG_H #define QDECLARATIVEENGINEDEBUG_H
#include "qmljsdebugclient_global.h" #include "qmljsdebugclient_global.h"
#include "qdeclarativedebugclient.h"
#include <QtCore/qobject.h> #include <QtCore/qobject.h>
#include <QtCore/qurl.h> #include <QtCore/qurl.h>
#include <QtCore/qvariant.h> #include <QtCore/qvariant.h>
...@@ -58,12 +59,10 @@ class QMLJSDEBUGCLIENT_EXPORT QDeclarativeEngineDebug : public QObject ...@@ -58,12 +59,10 @@ class QMLJSDEBUGCLIENT_EXPORT QDeclarativeEngineDebug : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
enum Status { NotConnected, Unavailable, Enabled };
explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0); explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0);
~QDeclarativeEngineDebug(); ~QDeclarativeEngineDebug();
Status status() const; QDeclarativeDebugClient::Status status() const;
QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &, QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &,
QObject *parent = 0); QObject *parent = 0);
...@@ -96,7 +95,7 @@ public: ...@@ -96,7 +95,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void newObjects(); void newObjects();
void statusChanged(Status status); void statusChanged(QDeclarativeDebugClient::Status status);
private: private:
Q_DECLARE_PRIVATE(QDeclarativeEngineDebug) Q_DECLARE_PRIVATE(QDeclarativeEngineDebug)
......
...@@ -68,6 +68,8 @@ void ClientProxy::connectToServer() ...@@ -68,6 +68,8 @@ void ClientProxy::connectToServer()
m_engineClient = new QDeclarativeEngineDebug(m_adapter.data()->connection(), this); m_engineClient = new QDeclarativeEngineDebug(m_adapter.data()->connection(), this);
connect(m_engineClient, SIGNAL(newObjects()), this, SLOT(newObjects())); 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); m_inspectorClient = new QmlJSInspectorClient(m_adapter.data()->connection(), this);
...@@ -104,8 +106,8 @@ void ClientProxy::connectToServer() ...@@ -104,8 +106,8 @@ void ClientProxy::connectToServer()
void ClientProxy::clientStatusChanged(QDeclarativeDebugClient::Status status) void ClientProxy::clientStatusChanged(QDeclarativeDebugClient::Status status)
{ {
QString serviceName; QString serviceName;
if (QDeclarativeDebugClient *client = qobject_cast<QDeclarativeDebugClient*>(sender())) { if (sender()) {
serviceName = client->name(); serviceName = sender()->objectName();
} }
if (m_adapter) if (m_adapter)
...@@ -613,7 +615,7 @@ void ClientProxy::reparentQmlObject(int debugId, int newParent) ...@@ -613,7 +615,7 @@ void ClientProxy::reparentQmlObject(int debugId, int newParent)
void ClientProxy::updateConnected() void ClientProxy::updateConnected()
{ {
bool isConnected = m_inspectorClient && m_inspectorClient->status() == QDeclarativeDebugClient::Enabled 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) { if (isConnected != m_isConnected) {
m_isConnected = isConnected; m_isConnected = isConnected;
......
...@@ -45,6 +45,7 @@ QmlJSInspectorClient::QmlJSInspectorClient(QDeclarativeDebugConnection *client, ...@@ -45,6 +45,7 @@ QmlJSInspectorClient::QmlJSInspectorClient(QDeclarativeDebugConnection *client,
: QDeclarativeDebugClient(QLatin1String("QDeclarativeObserverMode"), client) , : QDeclarativeDebugClient(QLatin1String("QDeclarativeObserverMode"), client) ,
m_connection(client) m_connection(client)
{ {
setObjectName(name());
} }
void QmlJSInspectorClient::statusChanged(Status status) void QmlJSInspectorClient::statusChanged(Status status)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment