Commit ad81c982 authored by Simjees Abraham's avatar Simjees Abraham Committed by Christiaan Janssen
Browse files

Debugger: Response for DESTROY_OBJECT message is used.



Response for DESTROY_OBJECT message is used to refresh the object
tree such that the destroyed object is not shown in the tree view.

Change-Id: I32d72fa75bbdca6c63551e71395816597dcc0b75
Reviewed-by: default avatarChristiaan Janssen <christiaan.janssen@nokia.com>
parent 0d6c47e4
...@@ -83,6 +83,7 @@ signals: ...@@ -83,6 +83,7 @@ signals:
void designModeBehaviorChanged(bool inDesignMode); void designModeBehaviorChanged(bool inDesignMode);
void showAppOnTopChanged(bool showAppOnTop); void showAppOnTopChanged(bool showAppOnTop);
void reloaded(); // the server has reloaded the document void reloaded(); // the server has reloaded the document
void destroyedObject();
void logActivity(QString client, QString message); void logActivity(QString client, QString message);
......
...@@ -67,7 +67,8 @@ QmlToolsClient::QmlToolsClient(QmlDebugConnection *client) ...@@ -67,7 +67,8 @@ QmlToolsClient::QmlToolsClient(QmlDebugConnection *client)
m_connection(client), m_connection(client),
m_requestId(0), m_requestId(0),
m_slowDownFactor(1), m_slowDownFactor(1),
m_reloadQueryId(-1) m_reloadQueryId(-1),
m_destroyObjectQueryId(-1)
{ {
setObjectName(name()); setObjectName(name());
} }
...@@ -87,6 +88,9 @@ void QmlToolsClient::messageReceived(const QByteArray &message) ...@@ -87,6 +88,9 @@ void QmlToolsClient::messageReceived(const QByteArray &message)
if ((m_reloadQueryId != -1) && (m_reloadQueryId == requestId) && success) if ((m_reloadQueryId != -1) && (m_reloadQueryId == requestId) && success)
emit reloaded(); emit reloaded();
if ((m_destroyObjectQueryId != -1) && (m_destroyObjectQueryId == requestId) && success)
emit destroyedObject();
log(LogReceive, type, QString(QLatin1String("requestId: %1 success: %2")) log(LogReceive, type, QString(QLatin1String("requestId: %1 success: %2"))
.arg(QString::number(requestId)).arg(QString::number(success))); .arg(QString::number(requestId)).arg(QString::number(success)));
} else if (type == QByteArray(EVENT)) { } else if (type == QByteArray(EVENT)) {
...@@ -277,6 +281,7 @@ void QmlToolsClient::destroyQmlObject(int debugId) ...@@ -277,6 +281,7 @@ void QmlToolsClient::destroyQmlObject(int debugId)
return; return;
QByteArray message; QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly); QDataStream ds(&message, QIODevice::WriteOnly);
m_destroyObjectQueryId = m_requestId;
ds << QByteArray(REQUEST) << m_requestId++ ds << QByteArray(REQUEST) << m_requestId++
<< QByteArray(DESTROY_OBJECT) << debugId; << QByteArray(DESTROY_OBJECT) << debugId;
......
...@@ -83,6 +83,7 @@ private: ...@@ -83,6 +83,7 @@ private:
int m_requestId; int m_requestId;
qreal m_slowDownFactor; qreal m_slowDownFactor;
int m_reloadQueryId; int m_reloadQueryId;
int m_destroyObjectQueryId;
}; };
} // namespace QmlDebug } // namespace QmlDebug
......
...@@ -204,6 +204,7 @@ void QmlInspectorAdapter::toolsClientStatusChanged(QmlDebug::ClientStatus status ...@@ -204,6 +204,7 @@ void QmlInspectorAdapter::toolsClientStatusChanged(QmlDebug::ClientStatus status
connect(client, SIGNAL(logActivity(QString,QString)), connect(client, SIGNAL(logActivity(QString,QString)),
m_debugAdapter, SLOT(logServiceActivity(QString,QString))); m_debugAdapter, SLOT(logServiceActivity(QString,QString)));
connect(client, SIGNAL(reloaded()), SLOT(onReloaded())); connect(client, SIGNAL(reloaded()), SLOT(onReloaded()));
connect(client, SIGNAL(destroyedObject()), SLOT(onDestroyedObject()));
// only enable zoom action for Qt 4.x/old client // only enable zoom action for Qt 4.x/old client
// (zooming is integrated into selection tool in Qt 5). // (zooming is integrated into selection tool in Qt 5).
...@@ -657,5 +658,10 @@ void QmlInspectorAdapter::onReloaded() ...@@ -657,5 +658,10 @@ void QmlInspectorAdapter::onReloaded()
} }
} }
void QmlInspectorAdapter::onDestroyedObject()
{
m_agent->refreshObjectTree();
}
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger
...@@ -99,6 +99,7 @@ private slots: ...@@ -99,6 +99,7 @@ private slots:
void onUpdateOnSaveChanged(const QVariant &value); void onUpdateOnSaveChanged(const QVariant &value);
void onReload(); void onReload();
void onReloaded(); void onReloaded();
void onDestroyedObject();
private: private:
void setActiveEngineClient(QmlDebug::BaseEngineDebugClient *client); void setActiveEngineClient(QmlDebug::BaseEngineDebugClient *client);
......
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