forked from qt-creator/qt-creator
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:
@@ -137,6 +137,18 @@ QString Overview::prettyName(const Name *name) const
|
||||
return pp(name);
|
||||
}
|
||||
|
||||
QString Overview::prettyName(const QList<const Name *> &fullyQualifiedName) const
|
||||
{
|
||||
QString result;
|
||||
const int size = fullyQualifiedName.size();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
result.append(prettyName(fullyQualifiedName.at(i)));
|
||||
if (i < size - 1)
|
||||
result.append(QLatin1String("::"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QString Overview::prettyType(const FullySpecifiedType &ty, const Name *name) const
|
||||
{
|
||||
return prettyType(ty, prettyName(name));
|
||||
|
||||
@@ -72,10 +72,14 @@ public:
|
||||
QString operator()(const Name *name) const
|
||||
{ return prettyName(name); }
|
||||
|
||||
QString operator()(const QList<const Name *> &fullyQualifiedName) const
|
||||
{ return prettyName(fullyQualifiedName); }
|
||||
|
||||
QString operator()(const FullySpecifiedType &type, const Name *name = 0) const
|
||||
{ return prettyType(type, name); }
|
||||
|
||||
QString prettyName(const Name *name) const;
|
||||
QString prettyName(const QList<const Name *> &fullyQualifiedName) const;
|
||||
QString prettyType(const FullySpecifiedType &type, const Name *name = 0) const;
|
||||
QString prettyType(const FullySpecifiedType &type, const QString &name) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user