forked from qt-creator/qt-creator
QmlDebugClient: Rename "status" to "state" for consistency
"state" is the more widely used term and we should follow that convention. We also need to distinguish between the state of the underlying network socket and the client itself. The change makes this explicit. As preparation for the upcoming centralized debug support the "State" enum of the debug client is also moved into the QmlDebugClient class. Change-Id: Ib9d7e03d23528f16ed696ed3518e813d11ea1c32 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -174,9 +174,9 @@ void BaseEngineDebugClient::decode(QDataStream &ds,
|
||||
}
|
||||
}
|
||||
|
||||
void BaseEngineDebugClient::statusChanged(ClientStatus status)
|
||||
void BaseEngineDebugClient::stateChanged(State state)
|
||||
{
|
||||
emit newStatus(status);
|
||||
emit newState(state);
|
||||
}
|
||||
|
||||
void BaseEngineDebugClient::messageReceived(const QByteArray &data)
|
||||
@@ -251,7 +251,7 @@ BaseEngineDebugClient::BaseEngineDebugClient(const QString &clientName,
|
||||
quint32 BaseEngineDebugClient::addWatch(const PropertyReference &property)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled) {
|
||||
if (state() == Enabled) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -273,7 +273,7 @@ quint32 BaseEngineDebugClient::addWatch(const ObjectReference &object,
|
||||
const QString &expr)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled) {
|
||||
if (state() == Enabled) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -286,7 +286,7 @@ quint32 BaseEngineDebugClient::addWatch(const ObjectReference &object,
|
||||
quint32 BaseEngineDebugClient::addWatch(int objectDebugId)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled) {
|
||||
if (state() == Enabled) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -304,7 +304,7 @@ quint32 BaseEngineDebugClient::addWatch(const FileReference &/*file*/)
|
||||
|
||||
void BaseEngineDebugClient::removeWatch(quint32 id)
|
||||
{
|
||||
if (status() == Enabled) {
|
||||
if (state() == Enabled) {
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
ds << QByteArray("NO_WATCH") << id;
|
||||
@@ -315,7 +315,7 @@ void BaseEngineDebugClient::removeWatch(quint32 id)
|
||||
quint32 BaseEngineDebugClient::queryAvailableEngines()
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled) {
|
||||
if (state() == Enabled) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -328,7 +328,7 @@ quint32 BaseEngineDebugClient::queryAvailableEngines()
|
||||
quint32 BaseEngineDebugClient::queryRootContexts(const EngineReference &engine)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && engine.m_debugId != -1) {
|
||||
if (state() == Enabled && engine.m_debugId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -341,7 +341,7 @@ quint32 BaseEngineDebugClient::queryRootContexts(const EngineReference &engine)
|
||||
quint32 BaseEngineDebugClient::queryObject(int objectId)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectId != -1) {
|
||||
if (state() == Enabled && objectId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -355,7 +355,7 @@ quint32 BaseEngineDebugClient::queryObject(int objectId)
|
||||
quint32 BaseEngineDebugClient::queryObjectRecursive(int objectId)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectId != -1) {
|
||||
if (state() == Enabled && objectId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -371,7 +371,7 @@ quint32 BaseEngineDebugClient::queryExpressionResult(int objectDebugId,
|
||||
int engineId)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectDebugId != -1) {
|
||||
if (state() == Enabled && objectDebugId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -390,7 +390,7 @@ quint32 BaseEngineDebugClient::setBindingForObject(
|
||||
QString source, int line)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectDebugId != -1) {
|
||||
if (state() == Enabled && objectDebugId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -406,7 +406,7 @@ quint32 BaseEngineDebugClient::resetBindingForObject(
|
||||
const QString &propertyName)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectDebugId != -1) {
|
||||
if (state() == Enabled && objectDebugId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -421,7 +421,7 @@ quint32 BaseEngineDebugClient::setMethodBody(
|
||||
const QString &methodBody)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectDebugId != -1) {
|
||||
if (state() == Enabled && objectDebugId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -436,7 +436,7 @@ quint32 BaseEngineDebugClient::queryObjectsForLocation(
|
||||
const QString &fileName, int lineNumber, int columnNumber)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled) {
|
||||
if (state() == Enabled) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
|
||||
@@ -78,14 +78,14 @@ public:
|
||||
int columnNumber);
|
||||
|
||||
signals:
|
||||
void newStatus(QmlDebug::ClientStatus status);
|
||||
void newState(QmlDebug::QmlDebugClient::State status);
|
||||
void newObject(int engineId, int objectId, int parentId);
|
||||
void valueChanged(int debugId, const QByteArray &name,
|
||||
const QVariant &value);
|
||||
void result(quint32 queryId, const QVariant &result, const QByteArray &type);
|
||||
|
||||
protected:
|
||||
virtual void statusChanged(ClientStatus status);
|
||||
virtual void stateChanged(State status);
|
||||
virtual void messageReceived(const QByteArray &);
|
||||
|
||||
quint32 getId() { return m_nextId++; }
|
||||
|
||||
@@ -37,9 +37,9 @@ BaseToolsClient::BaseToolsClient(QmlDebugConnection* client, QLatin1String clien
|
||||
setObjectName(clientName);
|
||||
}
|
||||
|
||||
void BaseToolsClient::statusChanged(ClientStatus status)
|
||||
void BaseToolsClient::stateChanged(State state)
|
||||
{
|
||||
emit newStatus(status);
|
||||
emit newState(state);
|
||||
}
|
||||
|
||||
void BaseToolsClient::recurseObjectIdList(const ObjectReference &ref,
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
virtual void clearComponentCache() = 0;
|
||||
|
||||
signals:
|
||||
void newStatus(QmlDebug::ClientStatus status);
|
||||
void newState(QmlDebug::QmlDebugClient::State status);
|
||||
|
||||
void currentObjectsChanged(const QList<int> &debugIds);
|
||||
void selectToolActivated();
|
||||
@@ -86,7 +86,7 @@ signals:
|
||||
void logActivity(QString client, QString message);
|
||||
|
||||
protected:
|
||||
void statusChanged(ClientStatus status);
|
||||
void stateChanged(State status);
|
||||
|
||||
void recurseObjectIdList(const ObjectReference &ref,
|
||||
QList<int> &debugIds, QList<QString> &objectIds);
|
||||
|
||||
@@ -47,7 +47,7 @@ quint32 DeclarativeEngineDebugClient::setBindingForObject(
|
||||
QString source, int line)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectDebugId != -1) {
|
||||
if (state() == Enabled && objectDebugId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -63,7 +63,7 @@ quint32 DeclarativeEngineDebugClient::resetBindingForObject(
|
||||
const QString &propertyName)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectDebugId != -1) {
|
||||
if (state() == Enabled && objectDebugId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
@@ -78,7 +78,7 @@ quint32 DeclarativeEngineDebugClient::setMethodBody(
|
||||
const QString &methodBody)
|
||||
{
|
||||
quint32 id = 0;
|
||||
if (status() == Enabled && objectDebugId != -1) {
|
||||
if (state() == Enabled && objectDebugId != -1) {
|
||||
id = getId();
|
||||
QByteArray message;
|
||||
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||
|
||||
@@ -42,9 +42,9 @@ QDebugMessageClient::~QDebugMessageClient()
|
||||
{
|
||||
}
|
||||
|
||||
void QDebugMessageClient::statusChanged(ClientStatus status)
|
||||
void QDebugMessageClient::stateChanged(State state)
|
||||
{
|
||||
emit newStatus(status);
|
||||
emit newState(state);
|
||||
}
|
||||
|
||||
void QDebugMessageClient::messageReceived(const QByteArray &data)
|
||||
|
||||
@@ -52,11 +52,11 @@ public:
|
||||
~QDebugMessageClient();
|
||||
|
||||
protected:
|
||||
virtual void statusChanged(ClientStatus status);
|
||||
virtual void stateChanged(State state);
|
||||
virtual void messageReceived(const QByteArray &);
|
||||
|
||||
signals:
|
||||
void newStatus(QmlDebug::ClientStatus);
|
||||
void newState(QmlDebug::QmlDebugClient::State);
|
||||
void message(QtMsgType, const QString &,
|
||||
const QmlDebug::QDebugContextInfo &);
|
||||
|
||||
|
||||
@@ -150,10 +150,10 @@ void QmlDebugConnectionPrivate::readyRead()
|
||||
|
||||
QHash<QString, QmlDebugClient *>::Iterator iter = plugins.begin();
|
||||
for (; iter != plugins.end(); ++iter) {
|
||||
ClientStatus newStatus = Unavailable;
|
||||
QmlDebugClient::State newState = QmlDebugClient::Unavailable;
|
||||
if (serverPlugins.contains(iter.key()))
|
||||
newStatus = Enabled;
|
||||
iter.value()->statusChanged(newStatus);
|
||||
newState = QmlDebugClient::Enabled;
|
||||
iter.value()->stateChanged(newState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,13 +189,13 @@ void QmlDebugConnectionPrivate::readyRead()
|
||||
QHash<QString, QmlDebugClient *>::Iterator iter = plugins.begin();
|
||||
for (; iter != plugins.end(); ++iter) {
|
||||
const QString pluginName = iter.key();
|
||||
ClientStatus newStatus = Unavailable;
|
||||
QmlDebugClient::State newState = QmlDebugClient::Unavailable;
|
||||
if (serverPlugins.contains(pluginName))
|
||||
newStatus = Enabled;
|
||||
newState = QmlDebugClient::Enabled;
|
||||
|
||||
if (oldServerPlugins.contains(pluginName)
|
||||
!= serverPlugins.contains(pluginName)) {
|
||||
iter.value()->statusChanged(newStatus);
|
||||
iter.value()->stateChanged(newState);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -225,24 +225,24 @@ QmlDebugConnection::~QmlDebugConnection()
|
||||
QHash<QString, QmlDebugClient*>::iterator iter = d->plugins.begin();
|
||||
for (; iter != d->plugins.end(); ++iter) {
|
||||
iter.value()->d_func()->connection = 0;
|
||||
iter.value()->statusChanged(NotConnected);
|
||||
iter.value()->stateChanged(QmlDebugClient::NotConnected);
|
||||
}
|
||||
}
|
||||
|
||||
bool QmlDebugConnection::isConnected() const
|
||||
{
|
||||
return state() == QAbstractSocket::ConnectedState;
|
||||
return socketState() == QAbstractSocket::ConnectedState;
|
||||
}
|
||||
|
||||
void QmlDebugConnection::close()
|
||||
{
|
||||
if (d->device->isOpen()) {
|
||||
d->device->close();
|
||||
emit stateChanged(QAbstractSocket::UnconnectedState);
|
||||
emit socketStateChanged(QAbstractSocket::UnconnectedState);
|
||||
|
||||
QHash<QString, QmlDebugClient*>::iterator iter = d->plugins.begin();
|
||||
for (; iter != d->plugins.end(); ++iter) {
|
||||
iter.value()->statusChanged(NotConnected);
|
||||
iter.value()->stateChanged(QmlDebugClient::NotConnected);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ QString QmlDebugConnection::errorString() const
|
||||
|
||||
// For ease of refactoring we use QAbstractSocket's states even if we're actually using a OstChannel underneath
|
||||
// since serial ports have a subset of the socket states afaics
|
||||
QAbstractSocket::SocketState QmlDebugConnection::state() const
|
||||
QAbstractSocket::SocketState QmlDebugConnection::socketState() const
|
||||
{
|
||||
QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(d->device);
|
||||
if (socket)
|
||||
@@ -280,7 +280,7 @@ void QmlDebugConnection::connectToHost(const QString &hostName, quint16 port)
|
||||
d->protocol = new QPacketProtocol(d->device, this);
|
||||
connect(d->protocol, SIGNAL(readyRead()), d, SLOT(readyRead()));
|
||||
d->gotHello = false;
|
||||
connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SIGNAL(stateChanged(QAbstractSocket::SocketState)));
|
||||
connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SIGNAL(socketStateChanged(QAbstractSocket::SocketState)));
|
||||
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SIGNAL(error(QAbstractSocket::SocketError)));
|
||||
connect(socket, SIGNAL(connected()), this, SIGNAL(connected()));
|
||||
socket->connectToHost(hostName, port);
|
||||
@@ -336,7 +336,7 @@ float QmlDebugClient::serviceVersion() const
|
||||
return -1;
|
||||
}
|
||||
|
||||
ClientStatus QmlDebugClient::status() const
|
||||
QmlDebugClient::State QmlDebugClient::state() const
|
||||
{
|
||||
Q_D(const QmlDebugClient);
|
||||
if (!d->connection
|
||||
@@ -353,7 +353,7 @@ ClientStatus QmlDebugClient::status() const
|
||||
void QmlDebugClient::sendMessage(const QByteArray &message)
|
||||
{
|
||||
Q_D(QmlDebugClient);
|
||||
if (status() != Enabled)
|
||||
if (state() != Enabled)
|
||||
return;
|
||||
|
||||
QPacket pack;
|
||||
@@ -362,7 +362,7 @@ void QmlDebugClient::sendMessage(const QByteArray &message)
|
||||
d->connection->flush();
|
||||
}
|
||||
|
||||
void QmlDebugClient::statusChanged(ClientStatus)
|
||||
void QmlDebugClient::stateChanged(State)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -49,14 +49,14 @@ public:
|
||||
void connectToHost(const QString &hostName, quint16 port);
|
||||
|
||||
bool isConnected() const;
|
||||
QAbstractSocket::SocketState state() const;
|
||||
QAbstractSocket::SocketState socketState() const;
|
||||
void flush();
|
||||
void close();
|
||||
QString errorString() const;
|
||||
|
||||
signals:
|
||||
void connected();
|
||||
void stateChanged(QAbstractSocket::SocketState socketState);
|
||||
void socketStateChanged(QAbstractSocket::SocketState state);
|
||||
void error(QAbstractSocket::SocketError socketError);
|
||||
|
||||
private:
|
||||
@@ -65,12 +65,6 @@ private:
|
||||
friend class QmlDebugClientPrivate;
|
||||
};
|
||||
|
||||
enum ClientStatus {
|
||||
NotConnected,
|
||||
Unavailable,
|
||||
Enabled
|
||||
};
|
||||
|
||||
class QmlDebugClientPrivate;
|
||||
class QMLDEBUG_EXPORT QmlDebugClient : public QObject
|
||||
{
|
||||
@@ -79,17 +73,19 @@ class QMLDEBUG_EXPORT QmlDebugClient : public QObject
|
||||
Q_DISABLE_COPY(QmlDebugClient)
|
||||
|
||||
public:
|
||||
enum State { NotConnected, Unavailable, Enabled };
|
||||
|
||||
QmlDebugClient(const QString &, QmlDebugConnection *parent);
|
||||
~QmlDebugClient();
|
||||
|
||||
QString name() const;
|
||||
float serviceVersion() const;
|
||||
ClientStatus status() const;
|
||||
State state() const;
|
||||
|
||||
virtual void sendMessage(const QByteArray &);
|
||||
|
||||
protected:
|
||||
virtual void statusChanged(ClientStatus);
|
||||
virtual void stateChanged(State);
|
||||
virtual void messageReceived(const QByteArray &);
|
||||
|
||||
private:
|
||||
|
||||
@@ -103,7 +103,7 @@ void QmlProfilerTraceClient::sendRecordingStatus()
|
||||
|
||||
bool QmlProfilerTraceClient::isEnabled() const
|
||||
{
|
||||
return status() == Enabled;
|
||||
return state() == Enabled;
|
||||
}
|
||||
|
||||
bool QmlProfilerTraceClient::isRecording() const
|
||||
@@ -118,7 +118,7 @@ void QmlProfilerTraceClient::setRecording(bool v)
|
||||
|
||||
d->recording = v;
|
||||
|
||||
if (status() == Enabled)
|
||||
if (state() == Enabled)
|
||||
sendRecordingStatus();
|
||||
|
||||
emit recordingChanged(v);
|
||||
@@ -132,7 +132,7 @@ void QmlProfilerTraceClient::setRecordingFromServer(bool v)
|
||||
emit recordingChanged(v);
|
||||
}
|
||||
|
||||
void QmlProfilerTraceClient::statusChanged(ClientStatus /*status*/)
|
||||
void QmlProfilerTraceClient::stateChanged(State /*status*/)
|
||||
{
|
||||
emit enabledChanged();
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ signals:
|
||||
void cleared();
|
||||
|
||||
protected:
|
||||
virtual void statusChanged(ClientStatus status);
|
||||
virtual void stateChanged(State status);
|
||||
virtual void messageReceived(const QByteArray &);
|
||||
|
||||
private:
|
||||
|
||||
@@ -87,7 +87,7 @@ void QV8ProfilerClient::clearData()
|
||||
|
||||
bool QV8ProfilerClient::isEnabled() const
|
||||
{
|
||||
return status() == Enabled;
|
||||
return state() == Enabled;
|
||||
}
|
||||
|
||||
void QV8ProfilerClient::sendRecordingStatus()
|
||||
@@ -107,7 +107,7 @@ void QV8ProfilerClient::setRecording(bool v)
|
||||
|
||||
d->recording = v;
|
||||
|
||||
if (status() == Enabled)
|
||||
if (state() == Enabled)
|
||||
sendRecordingStatus();
|
||||
|
||||
emit recordingChanged(v);
|
||||
@@ -123,7 +123,7 @@ void QV8ProfilerClient::setRecordingFromServer(bool v)
|
||||
emit recordingChanged(v);
|
||||
}
|
||||
|
||||
void QV8ProfilerClient::statusChanged(ClientStatus /*status*/)
|
||||
void QV8ProfilerClient::stateChanged(State /*status*/)
|
||||
{
|
||||
emit enabledChanged();
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
void setRecordingFromServer(bool);
|
||||
|
||||
protected:
|
||||
virtual void statusChanged(ClientStatus);
|
||||
virtual void stateChanged(State);
|
||||
virtual void messageReceived(const QByteArray &);
|
||||
|
||||
private:
|
||||
|
||||
@@ -56,14 +56,14 @@ bool BaseQmlDebuggerClient::acceptsBreakpoint(const BreakpointModelId &/*id*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
void BaseQmlDebuggerClient::statusChanged(QmlDebug::ClientStatus status)
|
||||
void BaseQmlDebuggerClient::stateChanged(State state)
|
||||
{
|
||||
emit newStatus(status);
|
||||
emit newState(state);
|
||||
}
|
||||
|
||||
void BaseQmlDebuggerClient::sendMessage(const QByteArray &msg)
|
||||
{
|
||||
if (status() == QmlDebug::Enabled)
|
||||
if (state() == Enabled)
|
||||
QmlDebugClient::sendMessage(msg);
|
||||
else
|
||||
d->sendBuffer.append(msg);
|
||||
@@ -71,7 +71,7 @@ void BaseQmlDebuggerClient::sendMessage(const QByteArray &msg)
|
||||
|
||||
void BaseQmlDebuggerClient::flushSendBuffer()
|
||||
{
|
||||
QTC_ASSERT(status() == QmlDebug::Enabled, return);
|
||||
QTC_ASSERT(state() == Enabled, return);
|
||||
foreach (const QByteArray &msg, d->sendBuffer)
|
||||
QmlDebugClient::sendMessage(msg);
|
||||
d->sendBuffer.clear();
|
||||
|
||||
@@ -91,11 +91,11 @@ public:
|
||||
void flushSendBuffer();
|
||||
|
||||
signals:
|
||||
void newStatus(QmlDebug::ClientStatus status);
|
||||
void newState(QmlDebug::QmlDebugClient::State state);
|
||||
void stackFrameCompleted();
|
||||
|
||||
protected:
|
||||
virtual void statusChanged(QmlDebug::ClientStatus status);
|
||||
virtual void stateChanged(State state);
|
||||
void sendMessage(const QByteArray &msg);
|
||||
|
||||
private:
|
||||
|
||||
@@ -59,15 +59,15 @@ QmlAdapter::QmlAdapter(DebuggerEngine *engine, QObject *parent)
|
||||
connect(&m_connectionTimer, SIGNAL(timeout()), SLOT(checkConnectionState()));
|
||||
|
||||
m_conn = new QmlDebugConnection(this);
|
||||
connect(m_conn, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
|
||||
connect(m_conn, SIGNAL(socketStateChanged(QAbstractSocket::SocketState)),
|
||||
SLOT(connectionStateChanged()));
|
||||
connect(m_conn, SIGNAL(error(QAbstractSocket::SocketError)),
|
||||
SLOT(connectionErrorOccurred(QAbstractSocket::SocketError)));
|
||||
|
||||
createDebuggerClients();
|
||||
m_msgClient = new QDebugMessageClient(m_conn);
|
||||
connect(m_msgClient, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(clientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(m_msgClient, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@ QmlAdapter::~QmlAdapter()
|
||||
void QmlAdapter::beginConnectionTcp(const QString &address, quint16 port)
|
||||
{
|
||||
if (m_engine.isNull()
|
||||
|| (m_conn && m_conn->state() != QAbstractSocket::UnconnectedState))
|
||||
|| (m_conn && m_conn->socketState() != QAbstractSocket::UnconnectedState))
|
||||
return;
|
||||
|
||||
showConnectionStatusMessage(tr("Connecting to debug server %1:%2").arg(address).arg(
|
||||
showConnectionStateMessage(tr("Connecting to debug server %1:%2").arg(address).arg(
|
||||
QString::number(port)));
|
||||
m_conn->connectToHost(address, port);
|
||||
|
||||
@@ -101,7 +101,7 @@ void QmlAdapter::closeConnection()
|
||||
|
||||
void QmlAdapter::connectionErrorOccurred(QAbstractSocket::SocketError socketError)
|
||||
{
|
||||
showConnectionStatusMessage(tr("Error: (%1) %2", "%1=error code, %2=error message")
|
||||
showConnectionStateMessage(tr("Error: (%1) %2", "%1=error code, %2=error message")
|
||||
.arg(socketError).arg(m_conn->errorString()));
|
||||
|
||||
// this is only an error if we are already connected and something goes wrong.
|
||||
@@ -113,7 +113,7 @@ void QmlAdapter::connectionErrorOccurred(QAbstractSocket::SocketError socketErro
|
||||
}
|
||||
}
|
||||
|
||||
void QmlAdapter::clientStatusChanged(QmlDebug::ClientStatus status)
|
||||
void QmlAdapter::clientStateChanged(QmlDebugClient::State state)
|
||||
{
|
||||
QString serviceName;
|
||||
float version = 0;
|
||||
@@ -122,12 +122,12 @@ void QmlAdapter::clientStatusChanged(QmlDebug::ClientStatus status)
|
||||
version = client->serviceVersion();
|
||||
}
|
||||
|
||||
logServiceStatusChange(serviceName, version, status);
|
||||
logServiceStateChange(serviceName, version, state);
|
||||
}
|
||||
|
||||
void QmlAdapter::debugClientStatusChanged(QmlDebug::ClientStatus status)
|
||||
void QmlAdapter::debugClientStateChanged(QmlDebugClient::State state)
|
||||
{
|
||||
if (status != QmlDebug::Enabled)
|
||||
if (state != QmlDebug::QmlDebugClient::Enabled)
|
||||
return;
|
||||
QmlDebugClient *client = qobject_cast<QmlDebugClient*>(sender());
|
||||
QTC_ASSERT(client, return);
|
||||
@@ -138,23 +138,23 @@ void QmlAdapter::debugClientStatusChanged(QmlDebug::ClientStatus status)
|
||||
|
||||
void QmlAdapter::connectionStateChanged()
|
||||
{
|
||||
switch (m_conn->state()) {
|
||||
switch (m_conn->socketState()) {
|
||||
case QAbstractSocket::UnconnectedState:
|
||||
{
|
||||
showConnectionStatusMessage(tr("Disconnected.") + QLatin1String("\n\n"));
|
||||
showConnectionStateMessage(tr("Disconnected.") + QLatin1String("\n\n"));
|
||||
emit disconnected();
|
||||
|
||||
break;
|
||||
}
|
||||
case QAbstractSocket::HostLookupState:
|
||||
showConnectionStatusMessage(tr("Resolving host."));
|
||||
showConnectionStateMessage(tr("Resolving host."));
|
||||
break;
|
||||
case QAbstractSocket::ConnectingState:
|
||||
showConnectionStatusMessage(tr("Connecting to debug server."));
|
||||
showConnectionStateMessage(tr("Connecting to debug server."));
|
||||
break;
|
||||
case QAbstractSocket::ConnectedState:
|
||||
{
|
||||
showConnectionStatusMessage(tr("Connected.") + QLatin1Char('\n'));
|
||||
showConnectionStateMessage(tr("Connected.") + QLatin1Char('\n'));
|
||||
|
||||
m_connectionTimer.stop();
|
||||
|
||||
@@ -163,7 +163,7 @@ void QmlAdapter::connectionStateChanged()
|
||||
break;
|
||||
}
|
||||
case QAbstractSocket::ClosingState:
|
||||
showConnectionStatusMessage(tr("Closing."));
|
||||
showConnectionStateMessage(tr("Closing."));
|
||||
break;
|
||||
case QAbstractSocket::BoundState:
|
||||
case QAbstractSocket::ListeningState:
|
||||
@@ -181,22 +181,22 @@ void QmlAdapter::checkConnectionState()
|
||||
|
||||
bool QmlAdapter::isConnected() const
|
||||
{
|
||||
return m_conn && m_qmlClient && m_conn->state() == QAbstractSocket::ConnectedState;
|
||||
return m_conn && m_qmlClient && m_conn->socketState() == QAbstractSocket::ConnectedState;
|
||||
}
|
||||
|
||||
void QmlAdapter::createDebuggerClients()
|
||||
{
|
||||
QScriptDebuggerClient *debugClient1 = new QScriptDebuggerClient(m_conn);
|
||||
connect(debugClient1, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(clientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(debugClient1, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(debugClientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(debugClient1, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
connect(debugClient1, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(debugClientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
|
||||
QmlV8DebuggerClient *debugClient2 = new QmlV8DebuggerClient(m_conn);
|
||||
connect(debugClient2, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(clientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(debugClient2, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(debugClientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(debugClient2, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
connect(debugClient2, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(debugClientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
|
||||
m_debugClients.insert(debugClient1->name(),debugClient1);
|
||||
m_debugClients.insert(debugClient2->name(),debugClient2);
|
||||
@@ -215,7 +215,7 @@ DebuggerEngine *QmlAdapter::debuggerEngine() const
|
||||
return m_engine.data();
|
||||
}
|
||||
|
||||
void QmlAdapter::showConnectionStatusMessage(const QString &message)
|
||||
void QmlAdapter::showConnectionStateMessage(const QString &message)
|
||||
{
|
||||
if (!m_engine.isNull())
|
||||
m_engine.data()->showMessage(_("QML Debugger: ") + message, LogStatus);
|
||||
@@ -242,23 +242,23 @@ QDebugMessageClient *QmlAdapter::messageClient() const
|
||||
return m_msgClient;
|
||||
}
|
||||
|
||||
void QmlAdapter::logServiceStatusChange(const QString &service, float version,
|
||||
QmlDebug::ClientStatus newStatus)
|
||||
void QmlAdapter::logServiceStateChange(const QString &service, float version,
|
||||
QmlDebug::QmlDebugClient::State newState)
|
||||
{
|
||||
switch (newStatus) {
|
||||
case QmlDebug::Unavailable: {
|
||||
showConnectionStatusMessage(_("Status of \"%1\" Version: %2 changed to \"unavailable\".").
|
||||
switch (newState) {
|
||||
case QmlDebug::QmlDebugClient::Unavailable: {
|
||||
showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'unavailable'.").
|
||||
arg(service).arg(QString::number(version)));
|
||||
break;
|
||||
}
|
||||
case QmlDebug::Enabled: {
|
||||
showConnectionStatusMessage(_("Status of \"%1\" Version: %2 changed to \"enabled\".").
|
||||
case QmlDebug::QmlDebugClient::Enabled: {
|
||||
showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'enabled'.").
|
||||
arg(service).arg(QString::number(version)));
|
||||
break;
|
||||
}
|
||||
|
||||
case QmlDebug::NotConnected: {
|
||||
showConnectionStatusMessage(_("Status of \"%1\" Version: %2 changed to \"not connected\".").
|
||||
case QmlDebug::QmlDebugClient::NotConnected: {
|
||||
showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'not connected'.").
|
||||
arg(service).arg(QString::number(version)));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
QmlDebug::QDebugMessageClient *messageClient() const;
|
||||
|
||||
public slots:
|
||||
void logServiceStatusChange(const QString &service, float version,
|
||||
QmlDebug::ClientStatus newStatus);
|
||||
void logServiceStateChange(const QString &service, float version,
|
||||
QmlDebug::QmlDebugClient::State newState);
|
||||
void logServiceActivity(const QString &service, const QString &logMessage);
|
||||
|
||||
signals:
|
||||
@@ -82,15 +82,15 @@ signals:
|
||||
|
||||
private slots:
|
||||
void connectionErrorOccurred(QAbstractSocket::SocketError socketError);
|
||||
void clientStatusChanged(QmlDebug::ClientStatus status);
|
||||
void debugClientStatusChanged(QmlDebug::ClientStatus status);
|
||||
void clientStateChanged(QmlDebug::QmlDebugClient::State state);
|
||||
void debugClientStateChanged(QmlDebug::QmlDebugClient::State state);
|
||||
void connectionStateChanged();
|
||||
void checkConnectionState();
|
||||
|
||||
private:
|
||||
bool isConnected() const;
|
||||
void createDebuggerClients();
|
||||
void showConnectionStatusMessage(const QString &message);
|
||||
void showConnectionStateMessage(const QString &message);
|
||||
void showConnectionErrorMessage(const QString &message);
|
||||
|
||||
private:
|
||||
|
||||
@@ -92,46 +92,46 @@ QmlInspectorAdapter::QmlInspectorAdapter(QmlAdapter *debugAdapter,
|
||||
QmlDebugConnection *connection = m_debugAdapter->connection();
|
||||
DeclarativeEngineDebugClient *engineClient1
|
||||
= new DeclarativeEngineDebugClient(connection);
|
||||
connect(engineClient1, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(clientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(engineClient1, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(engineClientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(engineClient1, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
connect(engineClient1, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(engineClientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
|
||||
QmlEngineDebugClient *engineClient2 = new QmlEngineDebugClient(connection);
|
||||
connect(engineClient2, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(clientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(engineClient2, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(engineClientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(engineClient2, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
connect(engineClient2, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(engineClientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
|
||||
DeclarativeEngineDebugClientV2 *engineClient3
|
||||
= new DeclarativeEngineDebugClientV2(connection);
|
||||
connect(engineClient3, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(clientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(engineClient3, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(engineClientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(engineClient3, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
connect(engineClient3, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(engineClientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
|
||||
m_engineClients.insert(engineClient1->name(), engineClient1);
|
||||
m_engineClients.insert(engineClient2->name(), engineClient2);
|
||||
m_engineClients.insert(engineClient3->name(), engineClient3);
|
||||
|
||||
if (engineClient1->status() == QmlDebug::Enabled)
|
||||
if (engineClient1->state() == QmlDebugClient::Enabled)
|
||||
setActiveEngineClient(engineClient1);
|
||||
if (engineClient2->status() == QmlDebug::Enabled)
|
||||
if (engineClient2->state() == QmlDebugClient::Enabled)
|
||||
setActiveEngineClient(engineClient2);
|
||||
if (engineClient3->status() == QmlDebug::Enabled)
|
||||
if (engineClient3->state() == QmlDebugClient::Enabled)
|
||||
setActiveEngineClient(engineClient3);
|
||||
|
||||
DeclarativeToolsClient *toolsClient1 = new DeclarativeToolsClient(connection);
|
||||
connect(toolsClient1, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(clientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(toolsClient1, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(toolsClientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(toolsClient1, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
connect(toolsClient1, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(toolsClientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
|
||||
QmlToolsClient *toolsClient2 = new QmlToolsClient(connection);
|
||||
connect(toolsClient2, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(clientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(toolsClient2, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(toolsClientStatusChanged(QmlDebug::ClientStatus)));
|
||||
connect(toolsClient2, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
connect(toolsClient2, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(toolsClientStateChanged(QmlDebug::QmlDebugClient::State)));
|
||||
|
||||
// toolbar
|
||||
m_selectAction->setObjectName(QLatin1String("QML Select Action"));
|
||||
@@ -184,7 +184,7 @@ QString QmlInspectorAdapter::currentSelectedDisplayName() const
|
||||
return m_currentSelectedDebugName;
|
||||
}
|
||||
|
||||
void QmlInspectorAdapter::clientStatusChanged(QmlDebug::ClientStatus status)
|
||||
void QmlInspectorAdapter::clientStateChanged(QmlDebugClient::State state)
|
||||
{
|
||||
QString serviceName;
|
||||
float version = 0;
|
||||
@@ -193,14 +193,14 @@ void QmlInspectorAdapter::clientStatusChanged(QmlDebug::ClientStatus status)
|
||||
version = client->serviceVersion();
|
||||
}
|
||||
|
||||
m_debugAdapter->logServiceStatusChange(serviceName, version, status);
|
||||
m_debugAdapter->logServiceStateChange(serviceName, version, state);
|
||||
}
|
||||
|
||||
void QmlInspectorAdapter::toolsClientStatusChanged(QmlDebug::ClientStatus status)
|
||||
void QmlInspectorAdapter::toolsClientStateChanged(QmlDebugClient::State state)
|
||||
{
|
||||
BaseToolsClient *client = qobject_cast<BaseToolsClient*>(sender());
|
||||
QTC_ASSERT(client, return);
|
||||
if (status == QmlDebug::Enabled) {
|
||||
if (state == QmlDebugClient::Enabled) {
|
||||
m_toolsClient = client;
|
||||
|
||||
connect(client, SIGNAL(currentObjectsChanged(QList<int>)),
|
||||
@@ -256,12 +256,12 @@ void QmlInspectorAdapter::toolsClientStatusChanged(QmlDebug::ClientStatus status
|
||||
}
|
||||
}
|
||||
|
||||
void QmlInspectorAdapter::engineClientStatusChanged(QmlDebug::ClientStatus status)
|
||||
void QmlInspectorAdapter::engineClientStateChanged(QmlDebugClient::State state)
|
||||
{
|
||||
BaseEngineDebugClient *client
|
||||
= qobject_cast<BaseEngineDebugClient*>(sender());
|
||||
|
||||
if (status == QmlDebug::Enabled && !m_engineClientConnected) {
|
||||
if (state == QmlDebugClient::Enabled && !m_engineClientConnected) {
|
||||
// We accept the first client that is enabled and reject the others.
|
||||
QTC_ASSERT(client, return);
|
||||
setActiveEngineClient(client);
|
||||
@@ -419,7 +419,7 @@ void QmlInspectorAdapter::setActiveEngineClient(BaseEngineDebugClient *client)
|
||||
m_engineClientConnected = true;
|
||||
|
||||
if (m_engineClient &&
|
||||
m_engineClient->status() == QmlDebug::Enabled) {
|
||||
m_engineClient->state() == QmlDebugClient::Enabled) {
|
||||
QmlJS::ModelManagerInterface *modelManager
|
||||
= QmlJS::ModelManagerInterface::instance();
|
||||
if (modelManager) {
|
||||
@@ -468,7 +468,7 @@ void QmlInspectorAdapter::initializePreviews()
|
||||
}
|
||||
}
|
||||
|
||||
void QmlInspectorAdapter::showConnectionStatusMessage(const QString &message)
|
||||
void QmlInspectorAdapter::showConnectionStateMessage(const QString &message)
|
||||
{
|
||||
m_engine->showMessage(_("QML Inspector: ") + message, LogStatus);
|
||||
}
|
||||
|
||||
@@ -78,9 +78,9 @@ signals:
|
||||
private slots:
|
||||
void onEngineStateChanged(const Debugger::DebuggerState);
|
||||
|
||||
void clientStatusChanged(QmlDebug::ClientStatus status);
|
||||
void toolsClientStatusChanged(QmlDebug::ClientStatus status);
|
||||
void engineClientStatusChanged(QmlDebug::ClientStatus status);
|
||||
void clientStateChanged(QmlDebug::QmlDebugClient::State state);
|
||||
void toolsClientStateChanged(QmlDebug::QmlDebugClient::State state);
|
||||
void engineClientStateChanged(QmlDebug::QmlDebugClient::State state);
|
||||
|
||||
void selectObjectsFromToolsClient(const QList<int> &debugIds);
|
||||
void onObjectFetched(const QmlDebug::ObjectReference &ref);
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
void setActiveEngineClient(QmlDebug::BaseEngineDebugClient *client);
|
||||
|
||||
void initializePreviews();
|
||||
void showConnectionStatusMessage(const QString &message);
|
||||
void showConnectionStateMessage(const QString &message);
|
||||
|
||||
enum SelectionTarget { NoTarget, ToolTarget, EditorTarget };
|
||||
void selectObject(
|
||||
|
||||
@@ -64,7 +64,7 @@ QmlInspectorAgent::QmlInspectorAgent(DebuggerEngine *engine, QObject *parent)
|
||||
{
|
||||
m_debugIdToIname.insert(-1, QByteArray("inspect"));
|
||||
connect(debuggerCore()->action(ShowQmlObjectTree),
|
||||
SIGNAL(valueChanged(QVariant)), SLOT(updateStatus()));
|
||||
SIGNAL(valueChanged(QVariant)), SLOT(updateState()));
|
||||
m_delayQueryTimer.setSingleShot(true);
|
||||
m_delayQueryTimer.setInterval(100);
|
||||
connect(&m_delayQueryTimer, SIGNAL(timeout()), SLOT(queryEngineContext()));
|
||||
@@ -393,8 +393,8 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client)
|
||||
return;
|
||||
|
||||
if (m_engineClient) {
|
||||
disconnect(m_engineClient, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(updateStatus()));
|
||||
disconnect(m_engineClient, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(updateState()));
|
||||
disconnect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)),
|
||||
this, SLOT(onResult(quint32,QVariant,QByteArray)));
|
||||
disconnect(m_engineClient, SIGNAL(newObject(int,int,int)),
|
||||
@@ -406,8 +406,8 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client)
|
||||
m_engineClient = client;
|
||||
|
||||
if (m_engineClient) {
|
||||
connect(m_engineClient, SIGNAL(newStatus(QmlDebug::ClientStatus)),
|
||||
this, SLOT(updateStatus()));
|
||||
connect(m_engineClient, SIGNAL(newState(QmlDebug::QmlDebugClient::State)),
|
||||
this, SLOT(updateState()));
|
||||
connect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)),
|
||||
this, SLOT(onResult(quint32,QVariant,QByteArray)));
|
||||
connect(m_engineClient, SIGNAL(newObject(int,int,int)),
|
||||
@@ -416,7 +416,7 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client)
|
||||
this, SLOT(onValueChanged(int,QByteArray,QVariant)));
|
||||
}
|
||||
|
||||
updateStatus();
|
||||
updateState();
|
||||
}
|
||||
|
||||
QString QmlInspectorAgent::displayName(int objectDebugId) const
|
||||
@@ -434,10 +434,10 @@ QString QmlInspectorAgent::displayName(int objectDebugId) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
void QmlInspectorAgent::updateStatus()
|
||||
void QmlInspectorAgent::updateState()
|
||||
{
|
||||
if (m_engineClient
|
||||
&& (m_engineClient->status() == QmlDebug::Enabled)
|
||||
&& (m_engineClient->state() == QmlDebugClient::Enabled)
|
||||
&& debuggerCore()->boolSetting(ShowQmlObjectTree)) {
|
||||
reloadEngines();
|
||||
} else {
|
||||
@@ -870,7 +870,7 @@ void QmlInspectorAgent::log(QmlInspectorAgent::LogDirection direction,
|
||||
bool QmlInspectorAgent::isConnected() const
|
||||
{
|
||||
return m_engineClient
|
||||
&& (m_engineClient->status() == QmlDebug::Enabled);
|
||||
&& (m_engineClient->state() == QmlDebugClient::Enabled);
|
||||
}
|
||||
|
||||
void QmlInspectorAgent::clearObjectTree()
|
||||
|
||||
@@ -103,7 +103,7 @@ signals:
|
||||
void jumpToObjectDefinition(const QmlDebug::FileReference &objSource, int debugId);
|
||||
|
||||
private slots:
|
||||
void updateStatus();
|
||||
void updateState();
|
||||
void onResult(quint32 queryId, const QVariant &value, const QByteArray &type);
|
||||
void newObject(int engineId, int objectId, int parentId);
|
||||
void onValueChanged(int debugId, const QByteArray &propertyName, const QVariant &value);
|
||||
|
||||
@@ -149,7 +149,7 @@ void QmlProfilerClientManager::connectClient(quint16 port)
|
||||
delete d->connection;
|
||||
d->connection = new QmlDebugConnection;
|
||||
enableServices();
|
||||
connect(d->connection, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
|
||||
connect(d->connection, SIGNAL(socketStateChanged(QAbstractSocket::SocketState)),
|
||||
this, SLOT(connectionStateChanged()));
|
||||
d->connectionTimer.start();
|
||||
d->tcpPort = port;
|
||||
@@ -237,7 +237,7 @@ void QmlProfilerClientManager::disconnectClientSignals()
|
||||
|
||||
void QmlProfilerClientManager::connectToClient()
|
||||
{
|
||||
if (!d->connection || d->connection->state() != QAbstractSocket::UnconnectedState)
|
||||
if (!d->connection || d->connection->socketState() != QAbstractSocket::UnconnectedState)
|
||||
return;
|
||||
|
||||
d->connection->connectToHost(d->tcpHost, d->tcpPort);
|
||||
@@ -293,7 +293,7 @@ void QmlProfilerClientManager::connectionStateChanged()
|
||||
{
|
||||
if (!d->connection)
|
||||
return;
|
||||
switch (d->connection->state()) {
|
||||
switch (d->connection->socketState()) {
|
||||
case QAbstractSocket::UnconnectedState:
|
||||
{
|
||||
if (QmlProfilerPlugin::debugOutput)
|
||||
@@ -359,7 +359,9 @@ void QmlProfilerClientManager::qmlComplete(qint64 maximumTime)
|
||||
if (maximumTime > d->modelManager->traceTime()->endTime())
|
||||
d->modelManager->traceTime()->setEndTime(maximumTime);
|
||||
d->qmlDataReady = true;
|
||||
if (!d->v8clientplugin || d->v8clientplugin.data()->status() != QmlDebug::Enabled || d->v8DataReady) {
|
||||
if (!d->v8clientplugin ||
|
||||
d->v8clientplugin.data()->state() != QmlDebug::QmlDebugClient::Enabled ||
|
||||
d->v8DataReady) {
|
||||
emit dataReadyForProcessing();
|
||||
// once complete is sent, reset the flags
|
||||
d->qmlDataReady = false;
|
||||
@@ -370,7 +372,9 @@ void QmlProfilerClientManager::qmlComplete(qint64 maximumTime)
|
||||
void QmlProfilerClientManager::v8Complete()
|
||||
{
|
||||
d->v8DataReady = true;
|
||||
if (!d->qmlclientplugin || d->qmlclientplugin.data()->status() != QmlDebug::Enabled || d->qmlDataReady) {
|
||||
if (!d->qmlclientplugin ||
|
||||
d->qmlclientplugin.data()->state() != QmlDebug::QmlDebugClient::Enabled ||
|
||||
d->qmlDataReady) {
|
||||
emit dataReadyForProcessing();
|
||||
// once complete is sent, reset the flags
|
||||
d->v8DataReady = false;
|
||||
|
||||
Reference in New Issue
Block a user