summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/CppDocument.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-11 10:44:06 +0100
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-11 11:50:46 +0100
commitcefd1832ce8cdc294ab4005ecfa31c1ffd9fb82a (patch)
tree5df5959c2b2b1e94bdf06a56e86381a89dc6e949 /src/libs/cplusplus/CppDocument.cpp
parent682a348b7bc22f9ada992ea5bd6495836d834cd5 (diff)
downloadqt-creator-cefd1832ce8cdc294ab4005ecfa31c1ffd9fb82a.tar.gz
C++: Include class name for inline functions in functionAt
The code that constructed the fully qualified name used enclosingNamespace() which skips classes. Use LookupContext::fullyQualifiedName() instead. Change-Id: Ic03a91c0fe120c52dc69f3e78e82a574458d8314 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/libs/cplusplus/CppDocument.cpp')
-rw-r--r--src/libs/cplusplus/CppDocument.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp
index 034e2f5585..5f001f2af7 100644
--- a/src/libs/cplusplus/CppDocument.cpp
+++ b/src/libs/cplusplus/CppDocument.cpp
@@ -518,21 +518,8 @@ QString Document::functionAt(int line, int column) const
return QString();
// We found the function scope, extract its name.
- const Overview o;
- QString rc = o.prettyName(scope->name());
-
- // Prepend namespace "Foo::Foo::foo()" up to empty root namespace
- for (const Symbol *owner = scope->enclosingNamespace();
- owner; owner = owner->enclosingNamespace()) {
- const QString name = o.prettyName(owner->name());
- if (name.isEmpty()) {
- break;
- } else {
- rc.prepend(QLatin1String("::"));
- rc.prepend(name);
- }
- }
- return rc;
+ const QList<const Name *> fullyQualifiedName = LookupContext::fullyQualifiedName(scope);
+ return Overview().prettyName(fullyQualifiedName);
}
Scope *Document::scopeAt(unsigned line, unsigned column)