diff --git a/src/libs/qmldebug/baseenginedebugclient.cpp b/src/libs/qmldebug/baseenginedebugclient.cpp index 9dc51c1084d1750ae89dbb63257e3dacc0d17eff..512437f8a0f6d9037284ebcda9c7891cac9c18df 100644 --- a/src/libs/qmldebug/baseenginedebugclient.cpp +++ b/src/libs/qmldebug/baseenginedebugclient.cpp @@ -230,7 +230,10 @@ void BaseEngineDebugClient::messageReceived(const QByteArray &data) emit result(queryId, exprResult, type); } else if (type == "WATCH_PROPERTY_R" || type == "WATCH_OBJECT_R" || - type == "WATCH_EXPR_OBJECT_R") { + type == "WATCH_EXPR_OBJECT_R" || + type == "SET_BINDING_R" || + type == "RESET_BINDING_R" || + type == "SET_METHOD_BODY_R") { bool valid; ds >> valid; emit result(queryId, valid, type); diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index 22a25c7f538387dc4065a5001f07da879d3853c0..6fbc41cbcfd40535f752ae55b9900719da221036 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -423,6 +423,14 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value, if (type == _("FETCH_OBJECT_R")) { log(LogReceive, _("FETCH_OBJECT_R %1").arg( qvariant_cast<ObjectReference>(value).idString())); + } else if (type == _("SET_BINDING_R") + || type == _("RESET_BINDING_R") + || type == _("SET_METHOD_BODY_R")) { + QString msg = QLatin1String(type) + tr(" success : "); + msg += value.toBool() ? "1" : "0"; + if (!value.toBool()) + emit automaticUpdateFailed(); + log(LogReceive, msg); } else { log(LogReceive, QLatin1String(type)); } diff --git a/src/plugins/debugger/qml/qmlinspectoragent.h b/src/plugins/debugger/qml/qmlinspectoragent.h index 4efe5b189495f185010bfa787441b8a3fb9d1a4c..88a469eadf5b8f7ccedc776024b852b02d716fdf 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.h +++ b/src/plugins/debugger/qml/qmlinspectoragent.h @@ -103,6 +103,7 @@ signals: void expressionResult(quint32 queryId, const QVariant &value); void propertyChanged(int debugId, const QByteArray &propertyName, const QVariant &propertyValue); + void automaticUpdateFailed(); private slots: void updateStatus(); diff --git a/src/plugins/debugger/qml/qmllivetextpreview.cpp b/src/plugins/debugger/qml/qmllivetextpreview.cpp index cb5c78f3af1b3ccf00d48ad437f33536f393f791..ee7ade0c953b93760561f461a0ef0b10d13d4df4 100644 --- a/src/plugins/debugger/qml/qmllivetextpreview.cpp +++ b/src/plugins/debugger/qml/qmllivetextpreview.cpp @@ -376,6 +376,8 @@ QmlLiveTextPreview::QmlLiveTextPreview(const QmlJS::Document::Ptr &doc, SIGNAL(fetchObjectsForLocation(QString,int,int)), m_inspectorAdapter->agent(), SLOT(fetchContextObjectsForLocation(QString,int,int))); + connect(m_inspectorAdapter->agent(), SIGNAL(automaticUpdateFailed()), + SLOT(onAutomaticUpdateFailed())); } void QmlLiveTextPreview::associateEditor(Core::IEditor *editor) @@ -598,7 +600,6 @@ void QmlLiveTextPreview::documentChanged(QmlJS::Document::Ptr doc) if (doc && m_previousDoc && doc->fileName() == m_previousDoc->fileName()) { if (doc->fileName().endsWith(".js")) { - m_changesUnsynchronizable = true; showSyncWarning(JSChangeWarning, QString(), 0, 0); m_previousDoc = doc; return; @@ -612,7 +613,6 @@ void QmlLiveTextPreview::documentChanged(QmlJS::Document::Ptr doc) if (delta.unsyncronizableChanges != NoUnsyncronizableChanges) { - m_changesUnsynchronizable = true; showSyncWarning(delta.unsyncronizableChanges, delta.unsyncronizableElementName, delta.unsyncronizableChangeLine, @@ -638,6 +638,11 @@ void QmlLiveTextPreview::editorContentsChanged() m_contentsChanged = true; } +void QmlLiveTextPreview::onAutomaticUpdateFailed() +{ + showSyncWarning(AutomaticUpdateFailed, QString(), -1, -1); +} + QList<int> QmlLiveTextPreview::objectReferencesForOffset(quint32 offset) { QList<int> result; @@ -688,11 +693,16 @@ void QmlLiveTextPreview::showSyncWarning( errorMessage = tr("The changes in JavaScript cannot be applied " "without reloading the QML application. "); break; + case AutomaticUpdateFailed: + errorMessage = tr("The changes made cannot be applied without " + "reloading the QML application. "); + break; case QmlLiveTextPreview::NoUnsyncronizableChanges: default: return; } + m_changesUnsynchronizable = true; errorMessage.append(tr("You can continue debugging, but behavior can be unexpected.")); // Clear infobars if present before showing the same. Otherwise multiple infobars diff --git a/src/plugins/debugger/qml/qmllivetextpreview.h b/src/plugins/debugger/qml/qmllivetextpreview.h index 7a6c052bb92d7c27fac1084823d85efa76799931..3353afcccd8fa770783c5d246513d7bfa375b148 100644 --- a/src/plugins/debugger/qml/qmllivetextpreview.h +++ b/src/plugins/debugger/qml/qmllivetextpreview.h @@ -84,13 +84,15 @@ private slots: const QString &wordAtCursor); void documentChanged(QmlJS::Document::Ptr doc); void editorContentsChanged(); + void onAutomaticUpdateFailed(); private: enum UnsyncronizableChangeType { NoUnsyncronizableChanges, AttributeChangeWarning, ElementChangeWarning, - JSChangeWarning + JSChangeWarning, + AutomaticUpdateFailed }; bool changeSelectedElements(const QList<int> offsets, const QString &wordAtCursor);