summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsdelta.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2010-10-07 13:13:05 +0200
committerKai Koehne <kai.koehne@nokia.com>2010-10-08 15:51:56 +0200
commitd1175f3ea2c305955fbf7ac67e4738f354e437cd (patch)
tree96680a9a4317a864be3e88ead0a8aac68305263d /src/libs/qmljs/qmljsdelta.cpp
parent6863a848e991a839e2b09ac0a9006c04ce9598a3 (diff)
downloadqt-creator-d1175f3ea2c305955fbf7ac67e4738f354e437cd.tar.gz
QmlJSObserver: Fix crash when adding an element to some .qml files
Make sure that the 'artifical' URL of the item created actually is absolute (starts with a file:///). Otherwise an Assert will be hit when the imports include e.g. a .js file, and the Engine tries to load it. Task-number: QTCREATORBUG-2644 Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/libs/qmljs/qmljsdelta.cpp')
-rw-r--r--src/libs/qmljs/qmljsdelta.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/qmljs/qmljsdelta.cpp b/src/libs/qmljs/qmljsdelta.cpp
index 6c71e3c5e7..6c44996264 100644
--- a/src/libs/qmljs/qmljsdelta.cpp
+++ b/src/libs/qmljs/qmljsdelta.cpp
@@ -363,7 +363,8 @@ void Delta::insert(UiObjectMember *member, UiObjectMember *parentMember, const Q
importList << doc->source().mid(importBegin, importEnd - importBegin);
}
- QString filename = doc->fileName() + QLatin1Char('_') + QString::number(doc->editorRevision())
+ // encode editorRevision, lineNumber in URL. See ClientProxy::buildDebugIdHashRecursive
+ QString filename = QLatin1String("file://") + doc->fileName() + QLatin1Char('_') + QString::number(doc->editorRevision())
+ QLatin1Char(':') + QString::number(uiObjectDef->firstSourceLocation().startLine-importList.count());
foreach(DebugId debugId, debugReferences) {
if (debugId != -1) {