summaryrefslogtreecommitdiff
path: root/src/plugins/qmljseditor/qmljsfindreferences.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-07-01 13:41:40 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2011-07-05 11:52:09 +0200
commit9ea0380a4dd5a681f1675cb5203e7a8c71764704 (patch)
tree0dab5e84e07349f16e3ae3def6337581f4abab55 /src/plugins/qmljseditor/qmljsfindreferences.cpp
parentf691d3824af0d2f3e03b85c31eae8996995a021e (diff)
downloadqt-creator-9ea0380a4dd5a681f1675cb5203e7a8c71764704.tar.gz
QmlJS: Enforce Context always being linked.
The default way of creating a Context is through Link. Change-Id: Ia81f7ce90ba2b33d02eed432a61be836d404bedd Reviewed-on: http://codereview.qt.nokia.com/1041 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Diffstat (limited to 'src/plugins/qmljseditor/qmljsfindreferences.cpp')
-rw-r--r--src/plugins/qmljseditor/qmljsfindreferences.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp
index 9f3f1c563b..210982f7a4 100644
--- a/src/plugins/qmljseditor/qmljsfindreferences.cpp
+++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp
@@ -812,13 +812,12 @@ static void find_helper(QFutureInterface<FindReferences::Usage> &future,
}
// find the scope for the name we're searching
- Context context(snapshot);
Document::Ptr doc = snapshot.document(fileName);
if (!doc)
return;
- Link link(&context, snapshot, ModelManagerInterface::instance()->importPaths());
- link();
+ Link link(snapshot, ModelManagerInterface::instance()->importPaths());
+ Context context = link();
ScopeBuilder builder(&context, doc);
builder.initializeRootScope();