QmlJs Live preview: Fixed a bug that lead an object to be associated with 2 debug id.

If an object is created at the same location of another old object,
It could be matched.
This commit is contained in:
Olivier Goffart
2010-08-03 17:42:45 +02:00
parent fc1006e296
commit eb44801bed

View File

@@ -118,7 +118,7 @@ void MapObjectWithDebugReference::processRecursive(const QDeclarativeDebugObject
SourceLocation loc = ast->firstSourceLocation();
if (object.source().columnNumber() == int(loc.startColumn)) {
QString objectFileName = object.source().url().toLocalFile();
if (object.source().lineNumber() == int(loc.startLine) && objectFileName == filename) {
if (!doc && object.source().lineNumber() == int(loc.startLine) && objectFileName == filename) {
result[ast] += object.debugId();
} else if (doc && objectFileName.startsWith(filename + QLatin1Char('_') + QString::number(doc->editorRevision()) + QLatin1Char(':'))) {
bool ok;