Skip to content

Commit

Permalink
Rename QDeclarativeEngineDebugServer to ~Service
Browse files Browse the repository at this point in the history
And fix the file names/location, too

Change-Id: If2d5ec0896332896ad11af748ec8f75c39e1555c
Reviewed-on: http://codereview.qt.nokia.com/3890
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
  • Loading branch information
Kai Koehne authored and Qt by Nokia committed Aug 31, 2011
1 parent 0f56ed1 commit 8804ec4
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 61 deletions.
6 changes: 4 additions & 2 deletions src/declarative/debugger/debugger.pri
Expand Up @@ -10,7 +10,8 @@ SOURCES += \
$$PWD/qdeclarativedebughelper.cpp \
$$PWD/qdeclarativedebugserver.cpp \
$$PWD/qdeclarativeinspectorservice.cpp \
$$PWD/qv8debugservice.cpp
$$PWD/qv8debugservice.cpp \
$$PWD/qdeclarativeenginedebugservice.cpp

HEADERS += \
$$PWD/qdeclarativedebuggerstatus_p.h \
Expand All @@ -25,4 +26,5 @@ HEADERS += \
$$PWD/qdeclarativedebugserverconnection_p.h \
$$PWD/qdeclarativeinspectorservice_p.h \
$$PWD/qdeclarativeinspectorinterface_p.h \
$$PWD/qv8debugservice_p.h
$$PWD/qv8debugservice_p.h \
$$PWD/qdeclarativeenginedebugservice_p.h
16 changes: 8 additions & 8 deletions src/declarative/debugger/qdeclarativedebug.cpp
Expand Up @@ -43,7 +43,7 @@

#include "private/qdeclarativedebugclient_p.h"

#include <qdeclarativeenginedebug_p.h>
#include <qdeclarativeenginedebugservice_p.h>

#include <private/qobject_p.h>

Expand Down Expand Up @@ -207,7 +207,7 @@ void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclara
void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o,
bool simple)
{
QDeclarativeEngineDebugServer::QDeclarativeObjectData data;
QDeclarativeEngineDebugService::QDeclarativeObjectData data;
ds >> data;
o.m_debugId = data.objectId;
o.m_class = data.objectType;
Expand All @@ -234,7 +234,7 @@ void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugOb
ds >> propCount;

for (int ii = 0; ii < propCount; ++ii) {
QDeclarativeEngineDebugServer::QDeclarativeObjectProperty data;
QDeclarativeEngineDebugService::QDeclarativeObjectProperty data;
ds >> data;
QDeclarativeDebugPropertyReference prop;
prop.m_objectDebugId = o.m_debugId;
Expand All @@ -243,21 +243,21 @@ void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugOb
prop.m_hasNotifySignal = data.hasNotifySignal;
prop.m_valueTypeName = data.valueTypeName;
switch (data.type) {
case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Basic:
case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::List:
case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::SignalProperty:
case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic:
case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List:
case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty:
{
prop.m_value = data.value;
break;
}
case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Object:
case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object:
{
QDeclarativeDebugObjectReference obj;
obj.m_debugId = prop.m_value.toInt();
prop.m_value = QVariant::fromValue(obj);
break;
}
case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Unknown:
case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown:
break;
}
o.m_properties << prop;
Expand Down
Expand Up @@ -39,7 +39,7 @@
**
****************************************************************************/

#include "private/qdeclarativeenginedebug_p.h"
#include "private/qdeclarativeenginedebugservice_p.h"

#include "private/qdeclarativeboundsignal_p.h"
#include "qdeclarativeengine.h"
Expand All @@ -59,14 +59,14 @@

QT_BEGIN_NAMESPACE

Q_GLOBAL_STATIC(QDeclarativeEngineDebugServer, qmlEngineDebugServer);
Q_GLOBAL_STATIC(QDeclarativeEngineDebugService, qmlEngineDebugService);

QDeclarativeEngineDebugServer *QDeclarativeEngineDebugServer::instance()
QDeclarativeEngineDebugService *QDeclarativeEngineDebugService::instance()
{
return qmlEngineDebugServer();
return qmlEngineDebugService();
}

QDeclarativeEngineDebugServer::QDeclarativeEngineDebugServer(QObject *parent)
QDeclarativeEngineDebugService::QDeclarativeEngineDebugService(QObject *parent)
: QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), parent),
m_watch(new QDeclarativeWatcher(this))
{
Expand All @@ -75,36 +75,36 @@ QDeclarativeEngineDebugServer::QDeclarativeEngineDebugServer(QObject *parent)
}

QDataStream &operator<<(QDataStream &ds,
const QDeclarativeEngineDebugServer::QDeclarativeObjectData &data)
const QDeclarativeEngineDebugService::QDeclarativeObjectData &data)
{
ds << data.url << data.lineNumber << data.columnNumber << data.idString
<< data.objectName << data.objectType << data.objectId << data.contextId;
return ds;
}

QDataStream &operator>>(QDataStream &ds,
QDeclarativeEngineDebugServer::QDeclarativeObjectData &data)
QDeclarativeEngineDebugService::QDeclarativeObjectData &data)
{
ds >> data.url >> data.lineNumber >> data.columnNumber >> data.idString
>> data.objectName >> data.objectType >> data.objectId >> data.contextId;
return ds;
}

QDataStream &operator<<(QDataStream &ds,
const QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &data)
const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data)
{
ds << (int)data.type << data.name << data.value << data.valueTypeName
<< data.binding << data.hasNotifySignal;
return ds;
}

QDataStream &operator>>(QDataStream &ds,
QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &data)
QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data)
{
int type;
ds >> type >> data.name >> data.value >> data.valueTypeName
>> data.binding >> data.hasNotifySignal;
data.type = (QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Type)type;
data.type = (QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Type)type;
return ds;
}

Expand All @@ -131,8 +131,8 @@ static bool hasValidSignal(QObject *object, const QString &propertyName)
return true;
}

QDeclarativeEngineDebugServer::QDeclarativeObjectProperty
QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
QDeclarativeEngineDebugService::QDeclarativeObjectProperty
QDeclarativeEngineDebugService::propertyData(QObject *obj, int propIdx)
{
QDeclarativeObjectProperty rv;

Expand Down Expand Up @@ -164,7 +164,7 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
return rv;
}

QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) const
QVariant QDeclarativeEngineDebugService::valueContents(const QVariant &value) const
{
int userType = value.userType();

Expand Down Expand Up @@ -193,7 +193,7 @@ QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) con
return QLatin1String("<unknown value>");
}

void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
void QDeclarativeEngineDebugService::buildObjectDump(QDataStream &message,
QObject *object, bool recur, bool dumpProperties)
{
message << objectData(object);
Expand Down Expand Up @@ -264,7 +264,7 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
message << fakeProperties[ii];
}

void QDeclarativeEngineDebugServer::prepareDeferredObjects(QObject *obj)
void QDeclarativeEngineDebugService::prepareDeferredObjects(QObject *obj)
{
qmlExecuteDeferred(obj);

Expand All @@ -276,7 +276,7 @@ void QDeclarativeEngineDebugServer::prepareDeferredObjects(QObject *obj)

}

void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDeclarativeContext *ctxt)
void QDeclarativeEngineDebugService::buildObjectList(QDataStream &message, QDeclarativeContext *ctxt)
{
QDeclarativeContextData *p = QDeclarativeContextData::get(ctxt);

Expand Down Expand Up @@ -316,7 +316,7 @@ void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDecla
}
}

void QDeclarativeEngineDebugServer::buildStatesList(QDeclarativeContext *ctxt, bool cleanList=false)
void QDeclarativeEngineDebugService::buildStatesList(QDeclarativeContext *ctxt, bool cleanList=false)
{
if (cleanList)
m_allStates.clear();
Expand All @@ -333,7 +333,7 @@ void QDeclarativeEngineDebugServer::buildStatesList(QDeclarativeContext *ctxt, b
}
}

void QDeclarativeEngineDebugServer::buildStatesList(QObject *obj)
void QDeclarativeEngineDebugService::buildStatesList(QObject *obj)
{
if (QDeclarativeState *state = qobject_cast<QDeclarativeState *>(obj)) {
m_allStates.append(state);
Expand All @@ -345,8 +345,8 @@ void QDeclarativeEngineDebugServer::buildStatesList(QObject *obj)
}
}

QDeclarativeEngineDebugServer::QDeclarativeObjectData
QDeclarativeEngineDebugServer::objectData(QObject *object)
QDeclarativeEngineDebugService::QDeclarativeObjectData
QDeclarativeEngineDebugService::objectData(QObject *object)
{
QDeclarativeData *ddata = QDeclarativeData::get(object);
QDeclarativeObjectData rv;
Expand Down Expand Up @@ -385,7 +385,7 @@ QDeclarativeEngineDebugServer::objectData(QObject *object)
return rv;
}

void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
void QDeclarativeEngineDebugService::messageReceived(const QByteArray &message)
{
QDataStream ds(message);

Expand Down Expand Up @@ -545,7 +545,7 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
}
}

void QDeclarativeEngineDebugServer::setBinding(int objectId,
void QDeclarativeEngineDebugService::setBinding(int objectId,
const QString &propertyName,
const QVariant &expression,
bool isLiteralValue,
Expand Down Expand Up @@ -600,7 +600,7 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId,
oldBinding->destroy();
binding->update();
} else {
qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object;
qWarning() << "QDeclarativeEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object;
}
}

Expand All @@ -613,13 +613,13 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId,
propertyChanges->changeExpression(propertyName, expression.toString());
}
} else {
qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object;
qWarning() << "QDeclarativeEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object;
}
}
}
}

void QDeclarativeEngineDebugServer::resetBinding(int objectId, const QString &propertyName)
void QDeclarativeEngineDebugService::resetBinding(int objectId, const QString &propertyName)
{
QObject *object = objectForId(objectId);
QDeclarativeContext *context = qmlContext(object);
Expand Down Expand Up @@ -664,7 +664,7 @@ void QDeclarativeEngineDebugServer::resetBinding(int objectId, const QString &pr
}
}

void QDeclarativeEngineDebugServer::setMethodBody(int objectId, const QString &method, const QString &body)
void QDeclarativeEngineDebugService::setMethodBody(int objectId, const QString &method, const QString &body)
{
QObject *object = objectForId(objectId);
QDeclarativeContext *context = qmlContext(object);
Expand Down Expand Up @@ -703,7 +703,7 @@ void QDeclarativeEngineDebugServer::setMethodBody(int objectId, const QString &m
vmeMetaObject->setVmeMethod(prop->coreIndex, QDeclarativeExpressionPrivate::evalFunction(contextData, object, jsfunction, contextData->url.toString(), lineNumber));
}

void QDeclarativeEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value)
void QDeclarativeEngineDebugService::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value)
{
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
Expand All @@ -713,23 +713,23 @@ void QDeclarativeEngineDebugServer::propertyChanged(int id, int objectId, const
sendMessage(reply);
}

void QDeclarativeEngineDebugServer::addEngine(QDeclarativeEngine *engine)
void QDeclarativeEngineDebugService::addEngine(QDeclarativeEngine *engine)
{
Q_ASSERT(engine);
Q_ASSERT(!m_engines.contains(engine));

m_engines.append(engine);
}

void QDeclarativeEngineDebugServer::remEngine(QDeclarativeEngine *engine)
void QDeclarativeEngineDebugService::remEngine(QDeclarativeEngine *engine)
{
Q_ASSERT(engine);
Q_ASSERT(m_engines.contains(engine));

m_engines.removeAll(engine);
}

void QDeclarativeEngineDebugServer::objectCreated(QDeclarativeEngine *engine, QObject *object)
void QDeclarativeEngineDebugService::objectCreated(QDeclarativeEngine *engine, QObject *object)
{
Q_ASSERT(engine);
Q_ASSERT(m_engines.contains(engine));
Expand Down
Expand Up @@ -39,8 +39,8 @@
**
****************************************************************************/

#ifndef QDECLARATIVEENGINEDEBUG_P_H
#define QDECLARATIVEENGINEDEBUG_P_H
#ifndef QDECLARATIVEENGINEDEBUGSERVICE_P_H
#define QDECLARATIVEENGINEDEBUGSERVICE_P_H

//
// W A R N I N G
Expand All @@ -67,11 +67,11 @@ class QDeclarativeWatcher;
class QDataStream;
class QDeclarativeState;

class QDeclarativeEngineDebugServer : public QDeclarativeDebugService
class QDeclarativeEngineDebugService : public QDeclarativeDebugService
{
Q_OBJECT
public:
QDeclarativeEngineDebugServer(QObject * = 0);
QDeclarativeEngineDebugService(QObject * = 0);

struct QDeclarativeObjectData {
QUrl url;
Expand All @@ -98,7 +98,7 @@ class QDeclarativeEngineDebugServer : public QDeclarativeDebugService
void remEngine(QDeclarativeEngine *);
void objectCreated(QDeclarativeEngine *, QObject *);

static QDeclarativeEngineDebugServer *instance();
static QDeclarativeEngineDebugService *instance();

protected:
virtual void messageReceived(const QByteArray &);
Expand All @@ -123,12 +123,12 @@ private Q_SLOTS:
QDeclarativeWatcher *m_watch;
QList<QWeakPointer<QDeclarativeState> > m_allStates;
};
Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugServer::QDeclarativeObjectData &);
Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugServer::QDeclarativeObjectData &);
Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &);
Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &);
Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectData &);
Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectData &);
Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &);
Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectProperty &);

QT_END_NAMESPACE

#endif // QDECLARATIVEENGINEDEBUG_P_H
#endif // QDECLARATIVEENGINEDEBUGSERVICE_P_H

4 changes: 2 additions & 2 deletions src/declarative/qml/qdeclarativecomponent.cpp
Expand Up @@ -53,7 +53,7 @@
#include "private/qdeclarativeglobal_p.h"
#include "private/qdeclarativescript_p.h"
#include "private/qdeclarativedebugtrace_p.h"
#include "private/qdeclarativeenginedebug_p.h"
#include "private/qdeclarativeenginedebugservice_p.h"

#include "private/qv8engine_p.h"
#include "private/qv8include_p.h"
Expand Down Expand Up @@ -952,7 +952,7 @@ QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *parentCon
if (enginePriv->isDebugging && rv) {
if (!parentContext->isInternal)
parentContext->asQDeclarativeContextPrivate()->instances.append(rv);
QDeclarativeEngineDebugServer::instance()->objectCreated(parentContext->engine, rv);
QDeclarativeEngineDebugService::instance()->objectCreated(parentContext->engine, rv);
if (isRoot) {
QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Creating, buildTypeNameForDebug(rv->metaObject()));
QDeclarativeData *data = QDeclarativeData::get(rv);
Expand Down

0 comments on commit 8804ec4

Please sign in to comment.