diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-05-21 11:35:03 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-05-21 11:35:37 +0200 |
commit | 09bf431ab578dcc02f46b7ae2c75da38c1cfa58e (patch) | |
tree | 1276cacc52fabde440617383dd1e754208940425 /src/libs/cplusplus/CppDocument.cpp | |
parent | 8ecbb441830043a1fb32965b9bb93cae1081edd0 (diff) | |
download | qt-creator-09bf431ab578dcc02f46b7ae2c75da38c1cfa58e.tar.gz |
Fixed jump to the matching definition.
Diffstat (limited to 'src/libs/cplusplus/CppDocument.cpp')
-rw-r--r-- | src/libs/cplusplus/CppDocument.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index eb17e4c9d7..cd7c0feb58 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -742,14 +742,17 @@ Symbol *Snapshot::findMatchingDefinition(Symbol *symbol) const QList<Function *> viableFunctions; + ClassOrNamespace *enclosingType = context.lookupType(declaration); + if (! enclosingType) + continue; // nothing to do + foreach (Function *fun, result) { const QList<Symbol *> declarations = context.lookup(fun->name(), fun->scope()); + if (declarations.isEmpty()) + continue; - if (declarations.contains(declaration)) + else if (enclosingType == context.lookupType(declarations.first())) viableFunctions.append(fun); - - else if (false) - qDebug() << "does not contain" << declaration->fileName() << declaration->line() << declaration->column(); } if (viableFunctions.isEmpty()) |