Commit 5692120e authored by Christiaan Janssen's avatar Christiaan Janssen

QmlDebugger: synchronize watches when deleted

Reviewed-by: Kai Koehne
parent d0d0a8c0
......@@ -230,7 +230,10 @@ void QmlEngine::connectionEstablished()
showMessage(tr("QML Debugger connected."), StatusBar);
synchronizeWatchers();
if (!watchHandler()->watcherNames().isEmpty()) {
synchronizeWatchers();
}
connect(watchersModel(),SIGNAL(layoutChanged()),this,SLOT(synchronizeWatchers()));
notifyEngineRunAndInferiorRunOk();
......@@ -359,6 +362,7 @@ bool QmlEngine::acceptsWatchesWhileRunning() const
void QmlEngine::closeConnection()
{
disconnect(watchersModel(),SIGNAL(layoutChanged()),this,SLOT(synchronizeWatchers()));
disconnect(&d->m_adapter, SIGNAL(connectionStartupFailed()),
this, SLOT(connectionStartupFailed()));
d->m_adapter.closeConnection();
......@@ -709,17 +713,15 @@ void QmlEngine::updateWatchData(const WatchData &data,
void QmlEngine::synchronizeWatchers()
{
if (!watchHandler()->watcherNames().isEmpty()) {
// send watchers list
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "WATCH_EXPRESSIONS";
rs << cmd;
rs << watchHandler()->watchedExpressions();
logMessage(LogSend, QString("%1 %2").arg(
QString(cmd), watchHandler()->watchedExpressions().join(", ")));
sendMessage(reply);
}
// send watchers list
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "WATCH_EXPRESSIONS";
rs << cmd;
rs << watchHandler()->watchedExpressions();
logMessage(LogSend, QString("%1 %2").arg(
QString(cmd), watchHandler()->watchedExpressions().join(", ")));
sendMessage(reply);
}
void QmlEngine::expandObject(const QByteArray &iname, quint64 objectId)
......
......@@ -132,6 +132,8 @@ private slots:
void serviceConnectionError(const QString &service);
void appendMessage(const QString &msg, ProjectExplorer::OutputFormat);
void synchronizeWatchers();
private:
void expandObject(const QByteArray &iname, quint64 objectId);
void sendPing();
......@@ -146,8 +148,6 @@ private:
const QString &oldBasePath, const QString &newBasePath) const;
QString qmlImportPath() const;
void synchronizeWatchers();
enum LogDirection {
LogSend,
LogReceive
......
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