forked from qt-creator/qt-creator
CppEditor: remove operator() overloads from OverView
Feels less obfuscated. Change-Id: Ide0ec1f38762038ddbb1eddb4f70f7d6acdf1ff7 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -304,25 +304,25 @@ private:
|
|||||||
virtual void visit(const DestructorNameId *name)
|
virtual void visit(const DestructorNameId *name)
|
||||||
{
|
{
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qWarning() << "ignored name:" << oo(name);
|
qWarning() << "ignored name:" << oo.prettyName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(const OperatorNameId *name)
|
virtual void visit(const OperatorNameId *name)
|
||||||
{
|
{
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qWarning() << "ignored name:" << oo(name);
|
qWarning() << "ignored name:" << oo.prettyName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(const ConversionNameId *name)
|
virtual void visit(const ConversionNameId *name)
|
||||||
{
|
{
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qWarning() << "ignored name:" << oo(name);
|
qWarning() << "ignored name:" << oo.prettyName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(const SelectorNameId *name)
|
virtual void visit(const SelectorNameId *name)
|
||||||
{
|
{
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qWarning() << "ignored name:" << oo(name);
|
qWarning() << "ignored name:" << oo.prettyName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -55,13 +55,13 @@ static QString indent(QString s, int level = 2)
|
|||||||
QString CPlusPlus::toString(const Name *name, QString id)
|
QString CPlusPlus::toString(const Name *name, QString id)
|
||||||
{
|
{
|
||||||
Overview oo;
|
Overview oo;
|
||||||
return QString("%0: %1").arg(id, name ? oo(name) : QLatin1String("(null)"));
|
return QString("%0: %1").arg(id, name ? oo.prettyName(name) : QLatin1String("(null)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CPlusPlus::toString(FullySpecifiedType ty, QString id)
|
QString CPlusPlus::toString(FullySpecifiedType ty, QString id)
|
||||||
{
|
{
|
||||||
Overview oo;
|
Overview oo;
|
||||||
return QString("%0: %1 (a %2)").arg(id, oo(ty), ty.type() ? typeid(*ty.type()).name() : "(null)");
|
return QString("%0: %1 (a %2)").arg(id, oo.prettyType(ty), ty.type() ? typeid(*ty.type()).name() : "(null)");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CPlusPlus::toString(const Symbol *s, QString id)
|
QString CPlusPlus::toString(const Symbol *s, QString id)
|
||||||
|
@@ -1106,7 +1106,7 @@ bool CreateBindings::visit(Declaration *decl)
|
|||||||
_currentClassOrNamespace->addNestedType(decl->name(), e);
|
_currentClassOrNamespace->addNestedType(decl->name(), e);
|
||||||
} else if (false) {
|
} else if (false) {
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qDebug() << "found entity not found for" << oo(namedTy->name());
|
qDebug() << "found entity not found for" << oo.prettyName(namedTy->name());
|
||||||
}
|
}
|
||||||
} else if (Class *klass = ty->asClassType()) {
|
} else if (Class *klass = ty->asClassType()) {
|
||||||
if (const Identifier *nameId = decl->name()->asNameId()) {
|
if (const Identifier *nameId = decl->name()->asNameId()) {
|
||||||
@@ -1131,7 +1131,7 @@ bool CreateBindings::visit(BaseClass *b)
|
|||||||
_currentClassOrNamespace->addUsing(base);
|
_currentClassOrNamespace->addUsing(base);
|
||||||
} else if (false) {
|
} else if (false) {
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qDebug() << "no entity for:" << oo(b->name());
|
qDebug() << "no entity for:" << oo.prettyName(b->name());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1157,7 +1157,7 @@ bool CreateBindings::visit(UsingNamespaceDirective *u)
|
|||||||
_currentClassOrNamespace->addUsing(e);
|
_currentClassOrNamespace->addUsing(e);
|
||||||
} else if (false) {
|
} else if (false) {
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qDebug() << "no entity for namespace:" << oo(u->name());
|
qDebug() << "no entity for namespace:" << oo.prettyName(u->name());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1173,7 +1173,7 @@ bool CreateBindings::visit(NamespaceAlias *a)
|
|||||||
|
|
||||||
} else if (false) {
|
} else if (false) {
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qDebug() << "no entity for namespace:" << oo(a->namespaceName());
|
qDebug() << "no entity for namespace:" << oo.prettyName(a->namespaceName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -1201,7 +1201,7 @@ bool CreateBindings::visit(ObjCBaseClass *b)
|
|||||||
_currentClassOrNamespace->addUsing(base);
|
_currentClassOrNamespace->addUsing(base);
|
||||||
} else if (false) {
|
} else if (false) {
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qDebug() << "no entity for:" << oo(b->name());
|
qDebug() << "no entity for:" << oo.prettyName(b->name());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1233,7 +1233,7 @@ bool CreateBindings::visit(ObjCBaseProtocol *b)
|
|||||||
_currentClassOrNamespace->addUsing(base);
|
_currentClassOrNamespace->addUsing(base);
|
||||||
} else if (false) {
|
} else if (false) {
|
||||||
Overview oo;
|
Overview oo;
|
||||||
qDebug() << "no entity for:" << oo(b->name());
|
qDebug() << "no entity for:" << oo.prettyName(b->name());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -345,7 +345,7 @@ void TypePrettyPrinter::visit(Function *type)
|
|||||||
if (_overview->showArgumentNames)
|
if (_overview->showArgumentNames)
|
||||||
name = arg->name();
|
name = arg->name();
|
||||||
|
|
||||||
_text += argumentText(arg->type(), name);
|
_text += argumentText.prettyType(arg->type(), name);
|
||||||
|
|
||||||
if (_overview->showDefaultArguments) {
|
if (_overview->showDefaultArguments) {
|
||||||
if (const StringLiteral *initializer = arg->initializer()) {
|
if (const StringLiteral *initializer = arg->initializer()) {
|
||||||
|
@@ -79,7 +79,7 @@ public:
|
|||||||
scope);
|
scope);
|
||||||
if (!candidates .isEmpty() && candidates.first().declaration()) {
|
if (!candidates .isEmpty() && candidates.first().declaration()) {
|
||||||
Symbol *decl = candidates.first().declaration();
|
Symbol *decl = candidates.first().declaration();
|
||||||
values << prettyPrint(LookupContext::fullyQualifiedName(decl));
|
values << prettyPrint.prettyName(LookupContext::fullyQualifiedName(decl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -194,7 +194,7 @@ QList<CppQuickFixOperation::Ptr> CompleteSwitchCaseStatement::match(
|
|||||||
Overview prettyPrint;
|
Overview prettyPrint;
|
||||||
for (unsigned i = 0; i < e->memberCount(); ++i) {
|
for (unsigned i = 0; i < e->memberCount(); ++i) {
|
||||||
if (Declaration *decl = e->memberAt(i)->asDeclaration()) {
|
if (Declaration *decl = e->memberAt(i)->asDeclaration()) {
|
||||||
values << prettyPrint(LookupContext::fullyQualifiedName(decl));
|
values << prettyPrint.prettyName(LookupContext::fullyQualifiedName(decl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Get the used values
|
// Get the used values
|
||||||
|
@@ -604,7 +604,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
|||||||
// abort if the name of the newly parsed function is not the expected one
|
// abort if the name of the newly parsed function is not the expected one
|
||||||
DeclaratorIdAST *newDeclId = getDeclaratorId(newDef->declarator);
|
DeclaratorIdAST *newDeclId = getDeclaratorId(newDef->declarator);
|
||||||
if (!newDeclId || !newDeclId->name || !newDeclId->name->name
|
if (!newDeclId || !newDeclId->name || !newDeclId->name->name
|
||||||
|| overview(newDeclId->name->name) != nameInitial) {
|
|| overview.prettyName(newDeclId->name->name) != nameInitial) {
|
||||||
return changes;
|
return changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -650,7 +650,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
|||||||
if (!newFunction->returnType().isEqualTo(sourceFunction->returnType())
|
if (!newFunction->returnType().isEqualTo(sourceFunction->returnType())
|
||||||
&& !newFunction->returnType().isEqualTo(targetFunction->returnType())) {
|
&& !newFunction->returnType().isEqualTo(targetFunction->returnType())) {
|
||||||
FullySpecifiedType type = rewriteType(newFunction->returnType(), &env, control);
|
FullySpecifiedType type = rewriteType(newFunction->returnType(), &env, control);
|
||||||
const QString replacement = overview(type, targetFunction->name());
|
const QString replacement = overview.prettyType(type, targetFunction->name());
|
||||||
changes.replace(returnTypeStart,
|
changes.replace(returnTypeStart,
|
||||||
targetFile->startOf(targetFunctionDeclarator->lparen_token),
|
targetFile->startOf(targetFunctionDeclarator->lparen_token),
|
||||||
replacement);
|
replacement);
|
||||||
@@ -706,19 +706,19 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
|||||||
QMultiHash<QString, int> sourceParamNameToIndex;
|
QMultiHash<QString, int> sourceParamNameToIndex;
|
||||||
for (int i = 0; i < existingParamCount; ++i) {
|
for (int i = 0; i < existingParamCount; ++i) {
|
||||||
Symbol *sourceParam = sourceFunction->argumentAt(i);
|
Symbol *sourceParam = sourceFunction->argumentAt(i);
|
||||||
sourceParamNameToIndex.insert(overview(sourceParam->name()), i);
|
sourceParamNameToIndex.insert(overview.prettyName(sourceParam->name()), i);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMultiHash<QString, int> newParamNameToIndex;
|
QMultiHash<QString, int> newParamNameToIndex;
|
||||||
for (int i = 0; i < newParamCount; ++i) {
|
for (int i = 0; i < newParamCount; ++i) {
|
||||||
Symbol *newParam = newFunction->argumentAt(i);
|
Symbol *newParam = newFunction->argumentAt(i);
|
||||||
newParamNameToIndex.insert(overview(newParam->name()), i);
|
newParamNameToIndex.insert(overview.prettyName(newParam->name()), i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// name-based binds (possibly disambiguated by type)
|
// name-based binds (possibly disambiguated by type)
|
||||||
for (int sourceParamIndex = 0; sourceParamIndex < existingParamCount; ++sourceParamIndex) {
|
for (int sourceParamIndex = 0; sourceParamIndex < existingParamCount; ++sourceParamIndex) {
|
||||||
Symbol *sourceParam = sourceFunction->argumentAt(sourceParamIndex);
|
Symbol *sourceParam = sourceFunction->argumentAt(sourceParamIndex);
|
||||||
const QString &name = overview(sourceParam->name());
|
const QString &name = overview.prettyName(sourceParam->name());
|
||||||
QList<int> newParams = newParamNameToIndex.values(name);
|
QList<int> newParams = newParamNameToIndex.values(name);
|
||||||
QList<int> sourceParams = sourceParamNameToIndex.values(name);
|
QList<int> sourceParams = sourceParamNameToIndex.values(name);
|
||||||
|
|
||||||
@@ -783,7 +783,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
|||||||
// if it's genuinely new, add it
|
// if it's genuinely new, add it
|
||||||
if (existingParamIndex == -1) {
|
if (existingParamIndex == -1) {
|
||||||
FullySpecifiedType type = rewriteType(newParam->type(), &env, control);
|
FullySpecifiedType type = rewriteType(newParam->type(), &env, control);
|
||||||
newTargetParam = overview(type, newParam->name());
|
newTargetParam = overview.prettyType(type, newParam->name());
|
||||||
hadChanges = true;
|
hadChanges = true;
|
||||||
}
|
}
|
||||||
// otherwise preserve as much as possible from the existing parameter
|
// otherwise preserve as much as possible from the existing parameter
|
||||||
@@ -821,7 +821,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
|||||||
|
|
||||||
// track renames
|
// track renames
|
||||||
if (replacementName != targetParam->name() && replacementName)
|
if (replacementName != targetParam->name() && replacementName)
|
||||||
renamedTargetParameters[targetParam] = overview(replacementName);
|
renamedTargetParameters[targetParam] = overview.prettyName(replacementName);
|
||||||
|
|
||||||
// need to change the type (and name)?
|
// need to change the type (and name)?
|
||||||
if (!newParam->type().isEqualTo(sourceParam->type())
|
if (!newParam->type().isEqualTo(sourceParam->type())
|
||||||
@@ -837,14 +837,14 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
|||||||
|
|
||||||
FullySpecifiedType replacementType = rewriteType(newParam->type(), &env, control);
|
FullySpecifiedType replacementType = rewriteType(newParam->type(), &env, control);
|
||||||
newTargetParam = targetFile->textOf(parameterStart, parameterTypeStart);
|
newTargetParam = targetFile->textOf(parameterStart, parameterTypeStart);
|
||||||
newTargetParam += overview(replacementType, replacementName);
|
newTargetParam += overview.prettyType(replacementType, replacementName);
|
||||||
newTargetParam += targetFile->textOf(parameterTypeEnd, parameterEnd);
|
newTargetParam += targetFile->textOf(parameterTypeEnd, parameterEnd);
|
||||||
hadChanges = true;
|
hadChanges = true;
|
||||||
}
|
}
|
||||||
// change the name only?
|
// change the name only?
|
||||||
else if (!namesEqual(targetParam->name(), replacementName)) {
|
else if (!namesEqual(targetParam->name(), replacementName)) {
|
||||||
DeclaratorIdAST *id = getDeclaratorId(targetParamAst->declarator);
|
DeclaratorIdAST *id = getDeclaratorId(targetParamAst->declarator);
|
||||||
const QString &replacementNameStr = overview(replacementName);
|
const QString &replacementNameStr = overview.prettyName(replacementName);
|
||||||
if (id) {
|
if (id) {
|
||||||
newTargetParam += targetFile->textOf(parameterStart, targetFile->startOf(id));
|
newTargetParam += targetFile->textOf(parameterStart, targetFile->startOf(id));
|
||||||
QString rest = targetFile->textOf(targetFile->endOf(id), parameterEnd);
|
QString rest = targetFile->textOf(targetFile->endOf(id), parameterEnd);
|
||||||
|
@@ -212,7 +212,7 @@ QString InsertDeclOperation::generateDeclaration(Function *function)
|
|||||||
oo.showArgumentNames = true;
|
oo.showArgumentNames = true;
|
||||||
|
|
||||||
QString decl;
|
QString decl;
|
||||||
decl += oo(function->type(), function->unqualifiedName());
|
decl += oo.prettyType(function->type(), function->unqualifiedName());
|
||||||
decl += QLatin1String(";\n");
|
decl += QLatin1String(";\n");
|
||||||
|
|
||||||
return decl;
|
return decl;
|
||||||
@@ -271,7 +271,7 @@ public:
|
|||||||
FullySpecifiedType tn = rewriteType(m_decl->type(), &env, control);
|
FullySpecifiedType tn = rewriteType(m_decl->type(), &env, control);
|
||||||
|
|
||||||
// rewrite the function name
|
// rewrite the function name
|
||||||
QString name = oo(LookupContext::minimalName(m_decl, targetCoN, control));
|
QString name = oo.prettyName(LookupContext::minimalName(m_decl, targetCoN, control));
|
||||||
|
|
||||||
QString defText = oo.prettyType(tn, name) + QLatin1String("\n{\n}");
|
QString defText = oo.prettyType(tn, name) + QLatin1String("\n{\n}");
|
||||||
|
|
||||||
|
@@ -102,7 +102,7 @@ QList<CppQuickFixOperation::Ptr> InsertQtPropertyMembers::match(
|
|||||||
Symbol *member = c->memberAt(i);
|
Symbol *member = c->memberAt(i);
|
||||||
FullySpecifiedType type = member->type();
|
FullySpecifiedType type = member->type();
|
||||||
if (member->asFunction() || (type.isValid() && type->asFunctionType())) {
|
if (member->asFunction() || (type.isValid() && type->asFunctionType())) {
|
||||||
const QString name = overview(member->name());
|
const QString name = overview.prettyName(member->name());
|
||||||
if (name == getterName) {
|
if (name == getterName) {
|
||||||
generateFlags &= ~GenerateGetter;
|
generateFlags &= ~GenerateGetter;
|
||||||
} else if (name == setterName) {
|
} else if (name == setterName) {
|
||||||
@@ -111,7 +111,7 @@ QList<CppQuickFixOperation::Ptr> InsertQtPropertyMembers::match(
|
|||||||
generateFlags &= ~GenerateSignal;
|
generateFlags &= ~GenerateSignal;
|
||||||
}
|
}
|
||||||
} else if (member->asDeclaration()) {
|
} else if (member->asDeclaration()) {
|
||||||
const QString name = overview(member->name());
|
const QString name = overview.prettyName(member->name());
|
||||||
if (name == storageName)
|
if (name == storageName)
|
||||||
generateFlags &= ~GenerateStorage;
|
generateFlags &= ~GenerateStorage;
|
||||||
}
|
}
|
||||||
|
@@ -1702,7 +1702,7 @@ private:
|
|||||||
FullySpecifiedType tn = rewriteType(result.first().type(), &env, control);
|
FullySpecifiedType tn = rewriteType(result.first().type(), &env, control);
|
||||||
|
|
||||||
Overview oo;
|
Overview oo;
|
||||||
QString ty = oo(tn);
|
QString ty = oo.prettyType(tn);
|
||||||
if (! ty.isEmpty()) {
|
if (! ty.isEmpty()) {
|
||||||
const QChar ch = ty.at(ty.size() - 1);
|
const QChar ch = ty.at(ty.size() - 1);
|
||||||
|
|
||||||
@@ -1848,7 +1848,7 @@ public:
|
|||||||
if (!existingResults.isEmpty())
|
if (!existingResults.isEmpty())
|
||||||
return noResult();
|
return noResult();
|
||||||
|
|
||||||
const QString &className = Overview()(innermostName->name);
|
const QString &className = Overview().prettyName(innermostName->name);
|
||||||
if (className.isEmpty())
|
if (className.isEmpty())
|
||||||
return noResult();
|
return noResult();
|
||||||
|
|
||||||
|
@@ -1134,9 +1134,9 @@ void CppCompletionAssistProcessor::completeObjCMsgSend(CPlusPlus::ClassOrNamespa
|
|||||||
text += QLatin1Char(':');
|
text += QLatin1Char(':');
|
||||||
text += TextEditor::Snippet::kVariableDelimiter;
|
text += TextEditor::Snippet::kVariableDelimiter;
|
||||||
text += QLatin1Char('(');
|
text += QLatin1Char('(');
|
||||||
text += oo(arg->type());
|
text += oo.prettyType(arg->type());
|
||||||
text += QLatin1Char(')');
|
text += QLatin1Char(')');
|
||||||
text += oo(arg->name());
|
text += oo.prettyName(arg->name());
|
||||||
text += TextEditor::Snippet::kVariableDelimiter;
|
text += TextEditor::Snippet::kVariableDelimiter;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1907,7 +1907,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
|||||||
const FullySpecifiedType localTy = rewriteType(f->type(), &env, control);
|
const FullySpecifiedType localTy = rewriteType(f->type(), &env, control);
|
||||||
|
|
||||||
// gets: "parameter list) cv-spec",
|
// gets: "parameter list) cv-spec",
|
||||||
QString completion = overview(localTy).mid(1);
|
QString completion = overview.prettyType(localTy).mid(1);
|
||||||
|
|
||||||
addCompletionItem(completion, QIcon(), 0,
|
addCompletionItem(completion, QIcon(), 0,
|
||||||
QVariant::fromValue(CompleteFunctionDeclaration(f)));
|
QVariant::fromValue(CompleteFunctionDeclaration(f)));
|
||||||
|
@@ -250,7 +250,7 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol,
|
|||||||
Overview overview;
|
Overview overview;
|
||||||
Find::SearchResult *search = Find::SearchResultWindow::instance()->startNewSearch(tr("C++ Usages:"),
|
Find::SearchResult *search = Find::SearchResultWindow::instance()->startNewSearch(tr("C++ Usages:"),
|
||||||
QString(),
|
QString(),
|
||||||
overview(context.fullyQualifiedName(symbol)),
|
overview.prettyName(context.fullyQualifiedName(symbol)),
|
||||||
replace ? Find::SearchResultWindow::SearchAndReplace
|
replace ? Find::SearchResultWindow::SearchAndReplace
|
||||||
: Find::SearchResultWindow::SearchOnly,
|
: Find::SearchResultWindow::SearchOnly,
|
||||||
QLatin1String("CppEditor"));
|
QLatin1String("CppEditor"));
|
||||||
|
@@ -516,7 +516,7 @@ static FullySpecifiedType stripPointerAndReference(const FullySpecifiedType &typ
|
|||||||
static QString toQmlType(const FullySpecifiedType &type)
|
static QString toQmlType(const FullySpecifiedType &type)
|
||||||
{
|
{
|
||||||
Overview overview;
|
Overview overview;
|
||||||
QString result = overview(stripPointerAndReference(type));
|
QString result = overview.prettyType(stripPointerAndReference(type));
|
||||||
if (result == QLatin1String("QString"))
|
if (result == QLatin1String("QString"))
|
||||||
result = QLatin1String("string");
|
result = QLatin1String("string");
|
||||||
return result;
|
return result;
|
||||||
@@ -553,7 +553,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
|||||||
|
|
||||||
Overview namePrinter;
|
Overview namePrinter;
|
||||||
|
|
||||||
fmo->setClassName(namePrinter(klass->name()));
|
fmo->setClassName(namePrinter.prettyName(klass->name()));
|
||||||
// add the no-package export, so the cpp name can be used in properties
|
// add the no-package export, so the cpp name can be used in properties
|
||||||
fmo->addExport(fmo->className(), QmlJS::CppQmlTypes::cppPackage, ComponentVersion());
|
fmo->addExport(fmo->className(), QmlJS::CppQmlTypes::cppPackage, ComponentVersion());
|
||||||
|
|
||||||
@@ -564,7 +564,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
|||||||
if (Function *func = member->type()->asFunctionType()) {
|
if (Function *func = member->type()->asFunctionType()) {
|
||||||
if (!func->isSlot() && !func->isInvokable() && !func->isSignal())
|
if (!func->isSlot() && !func->isInvokable() && !func->isSignal())
|
||||||
continue;
|
continue;
|
||||||
FakeMetaMethod method(namePrinter(func->name()), toQmlType(func->returnType()));
|
FakeMetaMethod method(namePrinter.prettyName(func->name()), toQmlType(func->returnType()));
|
||||||
if (func->isSignal())
|
if (func->isSignal())
|
||||||
method.setMethodType(FakeMetaMethod::Signal);
|
method.setMethodType(FakeMetaMethod::Signal);
|
||||||
else
|
else
|
||||||
@@ -573,7 +573,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
|||||||
Symbol *arg = func->argumentAt(a);
|
Symbol *arg = func->argumentAt(a);
|
||||||
QString name;
|
QString name;
|
||||||
if (arg->name())
|
if (arg->name())
|
||||||
name = namePrinter(arg->name());
|
name = namePrinter.prettyName(arg->name());
|
||||||
method.addParameter(name, toQmlType(arg->type()));
|
method.addParameter(name, toQmlType(arg->type()));
|
||||||
}
|
}
|
||||||
fmo->addMethod(method);
|
fmo->addMethod(method);
|
||||||
@@ -585,7 +585,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
|||||||
const bool isPointer = type.type() && type.type()->isPointerType();
|
const bool isPointer = type.type() && type.type()->isPointerType();
|
||||||
const int revision = 0; // ### fixme
|
const int revision = 0; // ### fixme
|
||||||
FakeMetaProperty property(
|
FakeMetaProperty property(
|
||||||
namePrinter(propDecl->name()),
|
namePrinter.prettyName(propDecl->name()),
|
||||||
toQmlType(type),
|
toQmlType(type),
|
||||||
isList, isWritable, isPointer,
|
isList, isWritable, isPointer,
|
||||||
revision);
|
revision);
|
||||||
@@ -594,7 +594,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
|||||||
if (QtEnum *qtEnum = member->asQtEnum()) {
|
if (QtEnum *qtEnum = member->asQtEnum()) {
|
||||||
// find the matching enum
|
// find the matching enum
|
||||||
Enum *e = 0;
|
Enum *e = 0;
|
||||||
QList<LookupItem> result = typeOf(namePrinter(qtEnum->name()).toUtf8(), klass);
|
QList<LookupItem> result = typeOf(namePrinter.prettyName(qtEnum->name()).toUtf8(), klass);
|
||||||
foreach (const LookupItem &item, result) {
|
foreach (const LookupItem &item, result) {
|
||||||
if (item.declaration()) {
|
if (item.declaration()) {
|
||||||
e = item.declaration()->asEnum();
|
e = item.declaration()->asEnum();
|
||||||
@@ -605,12 +605,12 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
|||||||
if (!e)
|
if (!e)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
FakeMetaEnum metaEnum(namePrinter(e->name()));
|
FakeMetaEnum metaEnum(namePrinter.prettyName(e->name()));
|
||||||
for (unsigned j = 0; j < e->memberCount(); ++j) {
|
for (unsigned j = 0; j < e->memberCount(); ++j) {
|
||||||
Symbol *enumMember = e->memberAt(j);
|
Symbol *enumMember = e->memberAt(j);
|
||||||
if (!enumMember->name())
|
if (!enumMember->name())
|
||||||
continue;
|
continue;
|
||||||
metaEnum.addKey(namePrinter(enumMember->name()), 0);
|
metaEnum.addKey(namePrinter.prettyName(enumMember->name()), 0);
|
||||||
}
|
}
|
||||||
fmo->addEnum(metaEnum);
|
fmo->addEnum(metaEnum);
|
||||||
}
|
}
|
||||||
@@ -622,7 +622,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
|||||||
if (!base->name())
|
if (!base->name())
|
||||||
return fmo;
|
return fmo;
|
||||||
|
|
||||||
const QString baseClassName = namePrinter(base->name());
|
const QString baseClassName = namePrinter.prettyName(base->name());
|
||||||
fmo->setSuperclassName(baseClassName);
|
fmo->setSuperclassName(baseClassName);
|
||||||
|
|
||||||
Class *baseClass = lookupClass(baseClassName, klass, typeOf);
|
Class *baseClass = lookupClass(baseClassName, klass, typeOf);
|
||||||
|
Reference in New Issue
Block a user