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