forked from qt-creator/qt-creator
Use const names.
This commit is contained in:
@@ -48,7 +48,7 @@ const Overview *NamePrettyPrinter::overview() const
|
||||
return _overview;
|
||||
}
|
||||
|
||||
QString NamePrettyPrinter::operator()(Name *name)
|
||||
QString NamePrettyPrinter::operator()(const Name *name)
|
||||
{
|
||||
QString previousName = switchName();
|
||||
accept(name);
|
||||
@@ -62,7 +62,7 @@ QString NamePrettyPrinter::switchName(const QString &name)
|
||||
return previousName;
|
||||
}
|
||||
|
||||
void NamePrettyPrinter::visit(NameId *name)
|
||||
void NamePrettyPrinter::visit(const NameId *name)
|
||||
{
|
||||
const Identifier *id = name->identifier();
|
||||
if (id)
|
||||
@@ -71,7 +71,7 @@ void NamePrettyPrinter::visit(NameId *name)
|
||||
_name = QLatin1String("anonymous");
|
||||
}
|
||||
|
||||
void NamePrettyPrinter::visit(TemplateNameId *name)
|
||||
void NamePrettyPrinter::visit(const TemplateNameId *name)
|
||||
{
|
||||
const Identifier *id = name->identifier();
|
||||
if (id)
|
||||
@@ -93,14 +93,14 @@ void NamePrettyPrinter::visit(TemplateNameId *name)
|
||||
_name += QLatin1Char('>');
|
||||
}
|
||||
|
||||
void NamePrettyPrinter::visit(DestructorNameId *name)
|
||||
void NamePrettyPrinter::visit(const DestructorNameId *name)
|
||||
{
|
||||
const Identifier *id = name->identifier();
|
||||
_name += QLatin1Char('~');
|
||||
_name += QString::fromLatin1(id->chars(), id->size());
|
||||
}
|
||||
|
||||
void NamePrettyPrinter::visit(OperatorNameId *name)
|
||||
void NamePrettyPrinter::visit(const OperatorNameId *name)
|
||||
{
|
||||
_name += QLatin1String("operator ");
|
||||
switch (name->kind()) { // ### i should probably do this in OperatorNameId
|
||||
@@ -236,13 +236,13 @@ void NamePrettyPrinter::visit(OperatorNameId *name)
|
||||
} // switch
|
||||
}
|
||||
|
||||
void NamePrettyPrinter::visit(ConversionNameId *name)
|
||||
void NamePrettyPrinter::visit(const ConversionNameId *name)
|
||||
{
|
||||
_name += QLatin1String("operator ");
|
||||
_name += overview()->prettyType(name->type());
|
||||
}
|
||||
|
||||
void NamePrettyPrinter::visit(QualifiedNameId *name)
|
||||
void NamePrettyPrinter::visit(const QualifiedNameId *name)
|
||||
{
|
||||
if (name->isGlobal())
|
||||
_name += QLatin1String("::");
|
||||
@@ -254,10 +254,10 @@ void NamePrettyPrinter::visit(QualifiedNameId *name)
|
||||
}
|
||||
}
|
||||
|
||||
void NamePrettyPrinter::visit(SelectorNameId *name)
|
||||
void NamePrettyPrinter::visit(const SelectorNameId *name)
|
||||
{
|
||||
for (unsigned i = 0; i < name->nameCount(); ++i) {
|
||||
Name *n = name->nameAt(i);
|
||||
const Name *n = name->nameAt(i);
|
||||
if (!n)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user