Fixes: Completing switch statements with enums in namespaces or classes.

We need to add the fully qualified name to the case statements.

Reviewed-by: Roberto Raggi
This commit is contained in:
con
2010-07-19 16:03:49 +02:00
parent caffe2c672
commit 5b989680ff
5 changed files with 73 additions and 14 deletions

View File

@@ -289,14 +289,8 @@ void CppHoverHandler::handleLookupItemMatch(const LookupItem &lookupItem, const
if (matchingDeclaration->enclosingSymbol()->isClass() ||
matchingDeclaration->enclosingSymbol()->isNamespace() ||
matchingDeclaration->enclosingSymbol()->isEnum()) {
const QList<const Name *> &names =
LookupContext::fullyQualifiedName(matchingDeclaration);
const int size = names.size();
for (int i = 0; i < size; ++i) {
qualifiedName.append(overview.prettyName(names.at(i)));
if (i < size - 1)
qualifiedName.append(QLatin1String("::"));
}
qualifiedName.append(overview.prettyName(
LookupContext::fullyQualifiedName(matchingDeclaration)));
} else {
qualifiedName.append(overview.prettyName(matchingDeclaration->name()));
}