summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsdelta.cpp
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@nokia.com>2010-09-22 16:28:13 +0200
committerChristiaan Janssen <christiaan.janssen@nokia.com>2010-09-22 16:30:21 +0200
commit0bc0a2df5a8faf4286800c6530a515e26a54a0c0 (patch)
treece2fee1868f2099cc5fae4a723a6ea1c05d93cba /src/libs/qmljs/qmljsdelta.cpp
parent02283ea84de4ff8c5d91050bd2e8aaae4a60d9bd (diff)
downloadqt-creator-0bc0a2df5a8faf4286800c6530a515e26a54a0c0.tar.gz
QmlObserver: showing a warning when changes cannot be synchronized
Reviewed by: Thomas Hartmann
Diffstat (limited to 'src/libs/qmljs/qmljsdelta.cpp')
-rw-r--r--src/libs/qmljs/qmljsdelta.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/libs/qmljs/qmljsdelta.cpp b/src/libs/qmljs/qmljsdelta.cpp
index 4cadf2f334..da0022a419 100644
--- a/src/libs/qmljs/qmljsdelta.cpp
+++ b/src/libs/qmljs/qmljsdelta.cpp
@@ -390,6 +390,9 @@ void Delta::update(UiObjectMember* oldObject, const QmlJS::Document::Ptr& oldDoc
const QString scriptCode = _scriptCode(script, newDoc);
UiScriptBinding *previousScript = cast<UiScriptBinding *>(oldMember);
if (!previousScript || _scriptCode(previousScript, oldDoc) != scriptCode) {
+ if (debugReferences.count()==0) {
+ notifyUnsyncronizableElementChange(newObject);
+ }
foreach (DebugId ref, debugReferences) {
if (ref != -1)
updateScriptBinding(ref, newObject, script, property, scriptCode);
@@ -401,6 +404,9 @@ void Delta::update(UiObjectMember* oldObject, const QmlJS::Document::Ptr& oldDoc
UiSourceElement *previousSource = cast<UiSourceElement*>(oldMember);
if (!previousSource || _methodCode(previousSource, oldDoc) != methodCode) {
+ if (debugReferences.count()==0) {
+ notifyUnsyncronizableElementChange(newObject);
+ }
foreach (DebugId ref, debugReferences) {
if (ref != -1)
updateMethodBody(ref, newObject, script, methodName, methodCode);
@@ -476,10 +482,13 @@ Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::P
UiObjectMember *x = M.way2[y];
Q_ASSERT(cast<UiObjectDefinition *>(x) || cast<UiObjectBinding *>(x) );
- if (debugIds.contains(x)) {
- QList<DebugId> ids = debugIds[x];
- newDebuggIds[y] = ids;
- update(x, doc1, y, doc2, ids);
+ {
+ QList<DebugId> updateIds;
+ if (debugIds.contains(x)) {
+ updateIds = debugIds[x];
+ newDebuggIds[y] = updateIds;
+ }
+ update(x, doc1, y, doc2, updateIds);
}
//qDebug() << "Delta::operator(): match "<< label(x, doc1) << "with parent " << label(parents1.parent.value(x), doc1)
// << " to "<< label(y, doc2) << "with parent " << label(parents2.parent.value(y), doc2);
@@ -533,5 +542,8 @@ void Delta::updateMethodBody(DebugId, UiObjectMember *, UiScriptBinding *, const
void Delta::updateScriptBinding(DebugId, UiObjectMember *, UiScriptBinding *, const QString &, const QString &)
{}
+void Delta::notifyUnsyncronizableElementChange(UiObjectMember *)
+{}
+
} //namespace QmlJs