From eb44801bedbad2e820b668446922c65c67a0ac97 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Tue, 3 Aug 2010 17:42:45 +0200
Subject: [PATCH] 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.
---
 src/plugins/qmljsinspector/qmljslivetextpreview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/qmljsinspector/qmljslivetextpreview.cpp b/src/plugins/qmljsinspector/qmljslivetextpreview.cpp
index 1078e0e359f..802d54c5545 100644
--- a/src/plugins/qmljsinspector/qmljslivetextpreview.cpp
+++ b/src/plugins/qmljsinspector/qmljslivetextpreview.cpp
@@ -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;
-- 
GitLab