public:
QDebugMessageServicePrivate()
: oldMsgHandler(0)
- , prevStatus(QDeclarativeDebugService::NotConnected)
+ , prevState(QDeclarativeDebugService::NotConnected)
{
}
QtMsgHandler oldMsgHandler;
- QDeclarativeDebugService::Status prevStatus;
+ QDeclarativeDebugService::State prevState;
};
QDebugMessageService::QDebugMessageService(QObject *parent) :
Q_D(QDebugMessageService);
registerService();
- if (status() == Enabled) {
+ if (state() == Enabled) {
d->oldMsgHandler = qInstallMsgHandler(DebugMessageHandler);
- d->prevStatus = Enabled;
+ d->prevState = Enabled;
}
}
(*d->oldMsgHandler)(type, buf);
}
-void QDebugMessageService::statusChanged(Status status)
+void QDebugMessageService::stateChanged(State state)
{
Q_D(QDebugMessageService);
- if (status != Enabled && d->prevStatus == Enabled) {
+ if (state != Enabled && d->prevState == Enabled) {
QtMsgHandler handler = qInstallMsgHandler(d->oldMsgHandler);
// has our handler been overwritten in between?
if (handler != DebugMessageHandler)
qInstallMsgHandler(handler);
- } else if (status == Enabled && d->prevStatus != Enabled) {
+ } else if (state == Enabled && d->prevState != Enabled) {
d->oldMsgHandler = qInstallMsgHandler(DebugMessageHandler);
}
- d->prevStatus = status;
+ d->prevState = state;
}
QT_END_NAMESPACE
void sendDebugMessage(QtMsgType type, const char *buf);
protected:
- void statusChanged(Status);
+ void stateChanged(State);
private:
Q_DISABLE_COPY(QDebugMessageService)
QHash<QString, QDeclarativeDebugClient *>::Iterator iter = plugins.begin();
for (; iter != plugins.end(); ++iter) {
- QDeclarativeDebugClient::Status newStatus = QDeclarativeDebugClient::Unavailable;
+ QDeclarativeDebugClient::State newState = QDeclarativeDebugClient::Unavailable;
if (serverPlugins.contains(iter.key()))
- newStatus = QDeclarativeDebugClient::Enabled;
- iter.value()->statusChanged(newStatus);
+ newState = QDeclarativeDebugClient::Enabled;
+ iter.value()->stateChanged(newState);
}
}
QHash<QString, QDeclarativeDebugClient *>::Iterator iter = plugins.begin();
for (; iter != plugins.end(); ++iter) {
const QString pluginName = iter.key();
- QDeclarativeDebugClient::Status newStatus = QDeclarativeDebugClient::Unavailable;
+ QDeclarativeDebugClient::State newSate = QDeclarativeDebugClient::Unavailable;
if (serverPlugins.contains(pluginName))
- newStatus = QDeclarativeDebugClient::Enabled;
+ newSate = QDeclarativeDebugClient::Enabled;
if (oldServerPlugins.contains(pluginName)
!= serverPlugins.contains(pluginName)) {
- iter.value()->statusChanged(newStatus);
+ iter.value()->stateChanged(newSate);
}
}
} else {
QHash<QString, QDeclarativeDebugClient*>::iterator iter = d->plugins.begin();
for (; iter != d->plugins.end(); ++iter) {
iter.value()->d_func()->connection = 0;
- iter.value()->statusChanged(QDeclarativeDebugClient::NotConnected);
+ iter.value()->stateChanged(QDeclarativeDebugClient::NotConnected);
}
}
QHash<QString, QDeclarativeDebugClient*>::iterator iter = d->plugins.begin();
for (; iter != d->plugins.end(); ++iter) {
- iter.value()->statusChanged(QDeclarativeDebugClient::NotConnected);
+ iter.value()->stateChanged(QDeclarativeDebugClient::NotConnected);
}
}
}
return -1;
}
-QDeclarativeDebugClient::Status QDeclarativeDebugClient::status() const
+QDeclarativeDebugClient::State QDeclarativeDebugClient::state() const
{
Q_D(const QDeclarativeDebugClient);
if (!d->connection
void QDeclarativeDebugClient::sendMessage(const QByteArray &message)
{
Q_D(QDeclarativeDebugClient);
- if (status() != Enabled)
+ if (state() != Enabled)
return;
QPacket pack;
d->connection->flush();
}
-void QDeclarativeDebugClient::statusChanged(Status)
+void QDeclarativeDebugClient::stateChanged(State)
{
}
Q_DISABLE_COPY(QDeclarativeDebugClient)
public:
- enum Status { NotConnected, Unavailable, Enabled };
+ enum State { NotConnected, Unavailable, Enabled };
QDeclarativeDebugClient(const QString &, QDeclarativeDebugConnection *parent);
~QDeclarativeDebugClient();
QString name() const;
float serviceVersion() const;
- Status status() const;
+ State state() const;
virtual void sendMessage(const QByteArray &);
protected:
- virtual void statusChanged(Status);
+ virtual void stateChanged(State);
virtual void messageReceived(const QByteArray &);
private:
QReadLocker(&d->pluginsLock);
{
foreach (QDeclarativeDebugService *service, d->plugins.values()) {
- service->statusAboutToBeChanged(QDeclarativeDebugService::NotConnected);
+ service->stateAboutToBeChanged(QDeclarativeDebugService::NotConnected);
service->d_func()->server = 0;
- service->d_func()->status = QDeclarativeDebugService::NotConnected;
- service->statusChanged(QDeclarativeDebugService::NotConnected);
+ service->d_func()->state = QDeclarativeDebugService::NotConnected;
+ service->stateChanged(QDeclarativeDebugService::NotConnected);
}
}
QReadLocker(&d->pluginsLock);
QHash<QString, QDeclarativeDebugService*>::ConstIterator iter = d->plugins.constBegin();
for (; iter != d->plugins.constEnd(); ++iter) {
- QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable;
+ QDeclarativeDebugService::State newState = QDeclarativeDebugService::Unavailable;
if (d->clientPlugins.contains(iter.key()))
- newStatus = QDeclarativeDebugService::Enabled;
- iter.value()->d_func()->status = newStatus;
- iter.value()->statusChanged(newStatus);
+ newState = QDeclarativeDebugService::Enabled;
+ iter.value()->d_func()->state = newState;
+ iter.value()->stateChanged(newState);
}
qWarning("QDeclarativeDebugServer: Connection established");
QHash<QString, QDeclarativeDebugService*>::ConstIterator iter = d->plugins.constBegin();
for (; iter != d->plugins.constEnd(); ++iter) {
const QString pluginName = iter.key();
- QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable;
+ QDeclarativeDebugService::State newState = QDeclarativeDebugService::Unavailable;
if (d->clientPlugins.contains(pluginName))
- newStatus = QDeclarativeDebugService::Enabled;
+ newState = QDeclarativeDebugService::Enabled;
if (oldClientPlugins.contains(pluginName)
!= d->clientPlugins.contains(pluginName)) {
- iter.value()->d_func()->status = newStatus;
- iter.value()->statusChanged(newStatus);
+ iter.value()->d_func()->state = newState;
+ iter.value()->stateChanged(newState);
}
}
{
QReadLocker(&d->pluginsLock);
d->advertisePlugins();
- QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable;
+ QDeclarativeDebugService::State newState = QDeclarativeDebugService::Unavailable;
if (d->clientPlugins.contains(service->name()))
- newStatus = QDeclarativeDebugService::Enabled;
- service->d_func()->status = newStatus;
+ newState = QDeclarativeDebugService::Enabled;
+ service->d_func()->state = newState;
}
return true;
}
}
{
QReadLocker(&d->pluginsLock);
- QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::NotConnected;
- service->statusAboutToBeChanged(newStatus);
+ QDeclarativeDebugService::State newState = QDeclarativeDebugService::NotConnected;
+ service->stateAboutToBeChanged(newState);
d->advertisePlugins();
service->d_func()->server = 0;
- service->d_func()->status = newStatus;
- service->statusChanged(newStatus);
+ service->d_func()->state = newState;
+ service->stateChanged(newState);
}
return true;
d->name = name;
d->version = version;
d->server = QDeclarativeDebugServer::instance();
- d->status = QDeclarativeDebugService::NotConnected;
+ d->state = QDeclarativeDebugService::NotConnected;
}
d->name = name;
d->version = version;
d->server = QDeclarativeDebugServer::instance();
- d->status = QDeclarativeDebugService::NotConnected;
+ d->state = QDeclarativeDebugService::NotConnected;
}
/**
Registers the service. This should be called in the constructor of the inherited class. From
then on the service might get asynchronous calls to messageReceived().
*/
-QDeclarativeDebugService::Status QDeclarativeDebugService::registerService()
+QDeclarativeDebugService::State QDeclarativeDebugService::registerService()
{
Q_D(QDeclarativeDebugService);
if (!d->server)
} else {
d->server->addService(this);
}
- return status();
+ return state();
}
QDeclarativeDebugService::~QDeclarativeDebugService()
return d->version;
}
-QDeclarativeDebugService::Status QDeclarativeDebugService::status() const
+QDeclarativeDebugService::State QDeclarativeDebugService::state() const
{
Q_D(const QDeclarativeDebugService);
- return d->status;
+ return d->state;
}
namespace {
{
Q_D(QDeclarativeDebugService);
- if (status() != Enabled)
+ if (state() != Enabled)
return;
d->server->sendMessages(this, messages);
{
Q_D(QDeclarativeDebugService);
- if (status() != Enabled)
+ if (state() != Enabled)
return false;
return d->server->waitForMessage(this);
}
-void QDeclarativeDebugService::statusAboutToBeChanged(Status)
+void QDeclarativeDebugService::stateAboutToBeChanged(State)
{
}
-void QDeclarativeDebugService::statusChanged(Status)
+void QDeclarativeDebugService::stateChanged(State)
{
}
QString name() const;
float version() const;
- enum Status { NotConnected, Unavailable, Enabled };
- Status status() const;
+ enum State { NotConnected, Unavailable, Enabled };
+ State state() const;
void sendMessage(const QByteArray &);
void sendMessages(const QList<QByteArray> &);
protected:
QDeclarativeDebugService(QDeclarativeDebugServicePrivate &dd, const QString &name, float version, QObject *parent = 0);
- Status registerService();
+ State registerService();
- virtual void statusAboutToBeChanged(Status);
- virtual void statusChanged(Status);
+ virtual void stateAboutToBeChanged(State);
+ virtual void stateChanged(State);
virtual void messageReceived(const QByteArray &);
private:
QString name;
float version;
QDeclarativeDebugServer *server;
- QDeclarativeDebugService::Status status;
+ QDeclarativeDebugService::State state;
};
QT_END_NAMESPACE
QDeclarativeDebugService::sendMessages(messages);
}
-void QDeclarativeDebugTrace::statusAboutToBeChanged(QDeclarativeDebugService::Status newStatus)
+void QDeclarativeDebugTrace::stateAboutToBeChanged(QDeclarativeDebugService::State newState)
{
- if (status() == newStatus)
+ if (state() == newState)
return;
- if (status() == Enabled
+ if (state() == Enabled
&& m_enabled) {
stopProfilingImpl();
sendMessages();
~QDeclarativeDebugTrace();
protected:
- virtual void statusAboutToBeChanged(Status status);
+ virtual void stateAboutToBeChanged(State state);
virtual void messageReceived(const QByteArray &);
private:
QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, QDeclarativeEngineDebugPrivate *p);
protected:
- virtual void statusChanged(Status status);
+ virtual void stateChanged(State state);
virtual void messageReceived(const QByteArray &);
private:
QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *);
~QDeclarativeEngineDebugPrivate();
- void statusChanged(QDeclarativeEngineDebug::Status status);
+ void stateChanged(QDeclarativeEngineDebug::State status);
void message(const QByteArray &);
QDeclarativeEngineDebugClient *client;
{
}
-void QDeclarativeEngineDebugClient::statusChanged(Status status)
+void QDeclarativeEngineDebugClient::stateChanged(State status)
{
if (priv)
- priv->statusChanged(static_cast<QDeclarativeEngineDebug::Status>(status));
+ priv->stateChanged(static_cast<QDeclarativeEngineDebug::State>(status));
}
void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data)
}
}
-void QDeclarativeEngineDebugPrivate::statusChanged(QDeclarativeEngineDebug::Status status)
+void QDeclarativeEngineDebugPrivate::stateChanged(QDeclarativeEngineDebug::State status)
{
- emit q_func()->statusChanged(status);
+ emit q_func()->stateChanged(status);
}
void QDeclarativeEngineDebugPrivate::message(const QByteArray &data)
{
}
-QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const
+QDeclarativeEngineDebug::State QDeclarativeEngineDebug::state() const
{
Q_D(const QDeclarativeEngineDebug);
- return static_cast<QDeclarativeEngineDebug::Status>(d->client->status());
+ return static_cast<QDeclarativeEngineDebug::State>(d->client->state());
}
QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent)
Q_D(QDeclarativeEngineDebug);
QDeclarativeDebugPropertyWatch *watch = new QDeclarativeDebugPropertyWatch(parent);
- if (d->client->status() == QDeclarativeDebugClient::Enabled) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled) {
int queryId = d->getId();
watch->m_queryId = queryId;
watch->m_client = this;
{
Q_D(QDeclarativeEngineDebug);
QDeclarativeDebugObjectExpressionWatch *watch = new QDeclarativeDebugObjectExpressionWatch(parent);
- if (d->client->status() == QDeclarativeDebugClient::Enabled) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled) {
int queryId = d->getId();
watch->m_queryId = queryId;
watch->m_client = this;
Q_D(QDeclarativeEngineDebug);
QDeclarativeDebugWatch *watch = new QDeclarativeDebugWatch(parent);
- if (d->client->status() == QDeclarativeDebugClient::Enabled) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled) {
int queryId = d->getId();
watch->m_queryId = queryId;
watch->m_client = this;
d->watched.remove(watch->queryId());
- if (d->client && d->client->status() == QDeclarativeDebugClient::Enabled) {
+ if (d->client && d->client->state() == QDeclarativeDebugClient::Enabled) {
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("NO_WATCH") << watch->queryId();
Q_D(QDeclarativeEngineDebug);
QDeclarativeDebugEnginesQuery *query = new QDeclarativeDebugEnginesQuery(parent);
- if (d->client->status() == QDeclarativeDebugClient::Enabled) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled) {
query->m_client = this;
int queryId = d->getId();
query->m_queryId = queryId;
Q_D(QDeclarativeEngineDebug);
QDeclarativeDebugRootContextQuery *query = new QDeclarativeDebugRootContextQuery(parent);
- if (d->client->status() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) {
query->m_client = this;
int queryId = d->getId();
query->m_queryId = queryId;
Q_D(QDeclarativeEngineDebug);
QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent);
- if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
query->m_client = this;
int queryId = d->getId();
query->m_queryId = queryId;
Q_D(QDeclarativeEngineDebug);
QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent);
- if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
query->m_client = this;
int queryId = d->getId();
query->m_queryId = queryId;
Q_D(QDeclarativeEngineDebug);
QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent);
- if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
query->m_client = this;
query->m_expr = expr;
int queryId = d->getId();
{
Q_D(QDeclarativeEngineDebug);
- if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line;
{
Q_D(QDeclarativeEngineDebug);
- if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName;
{
Q_D(QDeclarativeEngineDebug);
- if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
+ if (d->client->state() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody;
{
Q_OBJECT
public:
- enum Status { NotConnected, Unavailable, Enabled };
+ enum State { NotConnected, Unavailable, Enabled };
explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0);
~QDeclarativeEngineDebug();
- Status status() const;
+ State state() const;
QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &,
QObject *parent = 0);
Q_SIGNALS:
void newObjects();
- void statusChanged(Status status);
+ void stateChanged(State state);
private:
Q_DECLARE_PRIVATE(QDeclarativeEngineDebug)
void QDeclarativeInspectorService::addView(QObject *view)
{
m_views.append(view);
- updateStatus();
+ updateState();
}
void QDeclarativeInspectorService::removeView(QObject *view)
{
m_views.removeAll(view);
- updateStatus();
+ updateState();
}
void QDeclarativeInspectorService::sendMessage(const QByteArray &message)
{
- if (status() != Enabled)
+ if (state() != Enabled)
return;
QDeclarativeDebugService::sendMessage(message);
}
-void QDeclarativeInspectorService::statusChanged(Status /*status*/)
+void QDeclarativeInspectorService::stateChanged(State /*state*/)
{
- QMetaObject::invokeMethod(this, "updateStatus", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "updateState", Qt::QueuedConnection);
}
-void QDeclarativeInspectorService::updateStatus()
+void QDeclarativeInspectorService::updateState()
{
if (m_views.isEmpty()) {
if (m_currentInspectorPlugin) {
return;
}
- if (status() == Enabled) {
+ if (state() == Enabled) {
if (m_inspectorPlugins.isEmpty())
loadInspectorPlugins();
void sendMessage(const QByteArray &message);
protected:
- virtual void statusChanged(Status status);
+ virtual void stateChanged(State state);
virtual void messageReceived(const QByteArray &);
private slots:
void processMessage(const QByteArray &message);
- void updateStatus();
+ void updateState();
private:
void loadInspectorPlugins();
{
Q_D(QV8DebugService);
v8ServiceInstancePtr = this;
- // wait for statusChanged() -> initialize()
+ // wait for stateChanged() -> initialize()
d->initializeMutex.lock();
if (registerService() == Enabled) {
init();
}
// executed in the debugger thread
-void QV8DebugService::statusChanged(QDeclarativeDebugService::Status newStatus)
+void QV8DebugService::stateChanged(QDeclarativeDebugService::State newState)
{
Q_D(QV8DebugService);
- if (newStatus == Enabled) {
+ if (newState == Enabled) {
// execute in GUI thread
d->initializeMutex.lock();
QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);
void init();
protected:
- void statusChanged(Status newStatus);
+ void stateChanged(State newState);
void messageReceived(const QByteArray &);
private:
v8ProfilerInstance();
}
-void QV8ProfilerService::statusAboutToBeChanged(QDeclarativeDebugService::Status newStatus)
+void QV8ProfilerService::stateAboutToBeChanged(QDeclarativeDebugService::State newState)
{
Q_D(QV8ProfilerService);
- if (status() == newStatus)
+ if (state() == newState)
return;
- if (status() == Enabled) {
+ if (state() == Enabled) {
foreach (const QString &title, d->m_ongoing)
QMetaObject::invokeMethod(this, "stopProfiling", Qt::QueuedConnection, Q_ARG(QString, title));
sendProfilingData();
void sendProfilingData();
protected:
- void statusAboutToBeChanged(Status status);
+ void stateAboutToBeChanged(State state);
void messageReceived(const QByteArray &);
private:
protected:
//inherited from QDeclarativeDebugClient
- void statusChanged(Status status);
+ void stateChanged(State state);
void messageReceived(const QByteArray &data);
signals:
void debugOutput();
};
-void QDeclarativeDebugMsgClient::statusChanged(Status status)
+void QDeclarativeDebugMsgClient::stateChanged(State state)
{
- if (status == Enabled) {
+ if (state == Enabled) {
emit enabled();
}
}
void initTestCase();
void name();
- void status();
+ void state();
void sendMessage();
void parallelConnect();
void sequentialConnect();
QVERIFY(m_conn->isConnected());
QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
- QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled);
}
void tst_QDeclarativeDebugClient::name()
QCOMPARE(client.name(), name);
}
-void tst_QDeclarativeDebugClient::status()
+void tst_QDeclarativeDebugClient::state()
{
{
QDeclarativeDebugConnection dummyConn;
- QDeclarativeDebugClient client("tst_QDeclarativeDebugClient::status()", &dummyConn);
- QCOMPARE(client.status(), QDeclarativeDebugClient::NotConnected);
+ QDeclarativeDebugClient client("tst_QDeclarativeDebugClient::state()", &dummyConn);
+ QCOMPARE(client.state(), QDeclarativeDebugClient::NotConnected);
QCOMPARE(client.serviceVersion(), -1.0f);
}
- QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::status()", m_conn);
- QCOMPARE(client.status(), QDeclarativeDebugClient::Unavailable);
+ QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::state()", m_conn);
+ QCOMPARE(client.state(), QDeclarativeDebugClient::Unavailable);
{
- QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::status()", 2);
- QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::state()", 2);
+ QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled);
QCOMPARE(client.serviceVersion(), 2.0f);
}
- QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Unavailable);
+ QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Unavailable);
// duplicate plugin name
- QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugClient: Conflicting plugin name \"tst_QDeclarativeDebugClient::status()\" ");
- QDeclarativeDebugClient client2("tst_QDeclarativeDebugClient::status()", m_conn);
- QCOMPARE(client2.status(), QDeclarativeDebugClient::NotConnected);
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugClient: Conflicting plugin name \"tst_QDeclarativeDebugClient::state()\" ");
+ QDeclarativeDebugClient client2("tst_QDeclarativeDebugClient::state()", m_conn);
+ QCOMPARE(client2.state(), QDeclarativeDebugClient::NotConnected);
- QDeclarativeDebugClient client3("tst_QDeclarativeDebugClient::status3()", 0);
- QCOMPARE(client3.status(), QDeclarativeDebugClient::NotConnected);
+ QDeclarativeDebugClient client3("tst_QDeclarativeDebugClient::state3()", 0);
+ QCOMPARE(client3.state(), QDeclarativeDebugClient::NotConnected);
}
void tst_QDeclarativeDebugClient::sendMessage()
QByteArray msg = "hello!";
- QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled);
client.sendMessage(msg);
QByteArray resp = client.waitForResponse();
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established");
QVERIFY(connection2.waitForConnected());
QVERIFY(connection2.isConnected());
- QTRY_VERIFY(client2.status() == QDeclarativeDebugClient::Enabled);
+ QTRY_VERIFY(client2.state() == QDeclarativeDebugClient::Enabled);
}
int main(int argc, char *argv[])
protected:
//inherited from QDeclarativeDebugClient
- void statusChanged(Status status);
+ void stateChanged(State state);
void messageReceived(const QByteArray &data);
signals:
sendMessage(packMessage(V8REQUEST, json.toString().toUtf8()));
}
-void QJSDebugClient::statusChanged(Status status)
+void QJSDebugClient::stateChanged(State state)
{
- if (status == Enabled) {
+ if (state == Enabled) {
flushSendBuffer();
emit enabled();
}
void QJSDebugClient::sendMessage(const QByteArray &msg)
{
- if (status() == Enabled) {
+ if (state() == Enabled) {
QDeclarativeDebugClient::sendMessage(msg);
} else {
sendBuffer.append(msg);
void name();
void version();
- void status();
+ void state();
void sendMessage();
void idForObject();
void objectForId();
QCOMPARE(service.version(), 2.0f);
}
-void tst_QDeclarativeDebugService::status()
+void tst_QDeclarativeDebugService::state()
{
- QDeclarativeDebugTestService service("tst_QDeclarativeDebugService::status()");
- QCOMPARE(service.status(), QDeclarativeDebugService::Unavailable);
+ QDeclarativeDebugTestService service("tst_QDeclarativeDebugService::state()");
+ QCOMPARE(service.state(), QDeclarativeDebugService::Unavailable);
{
- QDeclarativeDebugTestClient client("tst_QDeclarativeDebugService::status()", m_conn);
- QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
- QTRY_COMPARE(service.status(), QDeclarativeDebugService::Enabled);
+ QDeclarativeDebugTestClient client("tst_QDeclarativeDebugService::state()", m_conn);
+ QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(service.state(), QDeclarativeDebugService::Enabled);
}
- QTRY_COMPARE(service.status(), QDeclarativeDebugService::Unavailable);
+ QTRY_COMPARE(service.state(), QDeclarativeDebugService::Unavailable);
- QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugService: Conflicting plugin name \"tst_QDeclarativeDebugService::status()\" ");
- QDeclarativeDebugTestService duplicate("tst_QDeclarativeDebugService::status()");
- QCOMPARE(duplicate.status(), QDeclarativeDebugService::NotConnected);
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugService: Conflicting plugin name \"tst_QDeclarativeDebugService::state()\" ");
+ QDeclarativeDebugTestService duplicate("tst_QDeclarativeDebugService::state()");
+ QCOMPARE(duplicate.state(), QDeclarativeDebugService::NotConnected);
}
void tst_QDeclarativeDebugService::sendMessage()
QByteArray msg = "hello!";
- QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
- QTRY_COMPARE(service.status(), QDeclarativeDebugService::Enabled);
+ QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(service.state(), QDeclarativeDebugService::Enabled);
client.sendMessage(msg);
QByteArray resp = client.waitForResponse();
QList<QDeclarativeDebugData> traceMessages;
- void setTraceStatus(bool enabled) {
+ void setTraceState(bool enabled) {
QByteArray message;
QDataStream stream(&message, QIODevice::WriteOnly);
stream << enabled;
void tst_QDeclarativeDebugTrace::blockingConnectWithTraceEnabled()
{
connect(true, "test.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
- m_client->setTraceStatus(true);
- m_client->setTraceStatus(false);
+ m_client->setTraceState(true);
+ m_client->setTraceState(false);
if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) {
QString failMsg
= QString("No trace received in time. App output: \n%1\n").arg(m_process->output());
void tst_QDeclarativeDebugTrace::blockingConnectWithTraceDisabled()
{
connect(true, "test.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
- m_client->setTraceStatus(false);
- m_client->setTraceStatus(true);
- m_client->setTraceStatus(false);
+ m_client->setTraceState(false);
+ m_client->setTraceState(true);
+ m_client->setTraceState(false);
if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) {
QString failMsg
= QString("No trace received in time. App output: \n%1\n").arg(m_process->output());
void tst_QDeclarativeDebugTrace::nonBlockingConnect()
{
connect(false, "test.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
- m_client->setTraceStatus(true);
- m_client->setTraceStatus(false);
+ m_client->setTraceState(true);
+ m_client->setTraceState(false);
if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) {
QString failMsg
= QString("No trace received in time. App output: \n%1\n").arg(m_process->output());
void tst_QDeclarativeDebugTrace::profileOnExit()
{
connect(true, "exit.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
- m_client->setTraceStatus(true);
+ m_client->setTraceState(true);
if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) {
QString failMsg
QVERIFY(ok);
QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
m_dbg = new QDeclarativeEngineDebug(m_conn, this);
- QTRY_VERIFY(m_dbg->status() == QDeclarativeEngineDebug::Enabled);
+ QTRY_VERIFY(m_dbg->state() == QDeclarativeEngineDebug::Enabled);
}
void tst_QDeclarativeEngineDebug::cleanupTestCase()
void tst_QDeclarativeInspector::connect()
{
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
}
void tst_QDeclarativeInspector::showAppOnTop()
{
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
m_client->setShowAppOnTop(true);
QVERIFY(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(showAppOnTopChanged())));
void tst_QV8ProfilerService::blockingConnectWithTraceEnabled()
{
connect(true, "test.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
m_client->startProfiling("");
m_client->stopProfiling("");
void tst_QV8ProfilerService::blockingConnectWithTraceDisabled()
{
connect(true, "test.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
m_client->stopProfiling("");
if (QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()), 1000)) {
void tst_QV8ProfilerService::nonBlockingConnect()
{
connect(false, "test.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
m_client->startProfiling("");
m_client->stopProfiling("");
void tst_QV8ProfilerService::snapshot()
{
connect(false, "test.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
m_client->takeSnapshot();
if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(snapshot()))) {
void tst_QV8ProfilerService::profileOnExit()
{
connect(true, "exit.qml");
- QTRY_COMPARE(m_client->status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled);
m_client->startProfiling("");
sendMessage(ba);
}
-void QDeclarativeDebugTestService::statusChanged(Status)
+void QDeclarativeDebugTestService::stateChanged(State)
{
- emit statusHasChanged();
+ emit stateHasChanged();
}
return lastMsg;
}
-void QDeclarativeDebugTestClient::statusChanged(Status stat)
+void QDeclarativeDebugTestClient::stateChanged(State stat)
{
- QCOMPARE(stat, status());
- emit statusHasChanged();
+ QCOMPARE(stat, state());
+ emit stateHasChanged();
}
void QDeclarativeDebugTestClient::messageReceived(const QByteArray &ba)
QDeclarativeDebugTestService(const QString &s, float version = 1, QObject *parent = 0);
signals:
- void statusHasChanged();
+ void stateHasChanged();
protected:
virtual void messageReceived(const QByteArray &ba);
- virtual void statusChanged(Status status);
+ virtual void stateChanged(State state);
};
class QDeclarativeDebugTestClient : public QDeclarativeDebugClient
QByteArray waitForResponse();
signals:
- void statusHasChanged();
+ void stateHasChanged();
void serverMessage(const QByteArray &);
protected:
- virtual void statusChanged(Status status);
+ virtual void stateChanged(State state);
virtual void messageReceived(const QByteArray &ba);
private: