diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index eb5a0b84d2447920ef94181fda0684005d132049..7fc43e3e53f285bfb5fa5dea5be07b62e64341fa 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -766,7 +766,7 @@ Symbol *Snapshot::findMatchingDefinition(Symbol *declaration) const Function *best = 0; foreach (Function *fun, viableFunctions) { - if (fun->identity()->isEqualTo(declaration->identity())) + if (fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName())) continue; else if (fun->argumentCount() == declarationTy->argumentCount()) { diff --git a/src/plugins/cppeditor/cppdeclfromdef.cpp b/src/plugins/cppeditor/cppdeclfromdef.cpp index 2af9c94dc9dc64ac360ed1a14ff5fd251714ce9c..f0ede56f5e462e99e371f3d67abd584249cce935 100644 --- a/src/plugins/cppeditor/cppdeclfromdef.cpp +++ b/src/plugins/cppeditor/cppdeclfromdef.cpp @@ -178,7 +178,7 @@ QString DeclFromDef::generateDeclaration(const CppQuickFixState &, oo.setShowArgumentNames(true); QString decl; - decl += oo(method->type(), method->identity()); + decl += oo(method->type(), method->unqualifiedName()); decl += QLatin1String(";\n"); return decl; diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 98e39ee8b2d6509b8943cf179be4560343d48ae2..87f7b5bfaf345d81bcb0c9009ab2bf6c4501ded4 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -151,7 +151,7 @@ public: TextEditor::CompletionItem previousItem = switchCompletionItem(0); Symbol *previousSymbol = switchSymbol(symbol); - accept(symbol->identity()); + accept(symbol->unqualifiedName()); if (_item.isValid()) _item.data = QVariant::fromValue(symbol); (void) switchSymbol(previousSymbol); @@ -1849,7 +1849,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item, QChar t if (Function *function = symbol->type()->asFunctionType()) { // If the member is a function, automatically place the opening parenthesis, // except when it might take template parameters. - if (! function->hasReturnType() && (function->identity() && !function->identity()->isDestructorNameId())) { + if (! function->hasReturnType() && (function->unqualifiedName() && !function->unqualifiedName()->isDestructorNameId())) { // Don't insert any magic, since the user might have just wanted to select the class /// ### port me diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index d0e031d772923f0d0055c0b99d4cc29a854020fd..828f0ce2efb9378968e43f19826f7105bae784c8 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -114,7 +114,7 @@ bool SearchSymbols::visit(Function *symbol) QString name = symbolName(symbol); QString scopedName = scopedSymbolName(name); QString type = overview.prettyType(symbol->type(), - separateScope ? symbol->identity() : 0); + separateScope ? symbol->unqualifiedName() : 0); appendItem(separateScope ? type : scopedName, separateScope ? fullScope : type, ModelItemInfo::Method, symbol); @@ -140,7 +140,7 @@ bool SearchSymbols::visit(Declaration *symbol) QString name = symbolName(symbol); QString scopedName = scopedSymbolName(name); QString type = overview.prettyType(symbol->type(), - separateScope ? symbol->identity() : 0); + separateScope ? symbol->unqualifiedName() : 0); appendItem(separateScope ? type : scopedName, separateScope ? _scope : type, ModelItemInfo::Declaration, symbol); diff --git a/src/shared/cplusplus/Scope.cpp b/src/shared/cplusplus/Scope.cpp index 8d70b7854ae4df8d2c5d72fa6cd6ced905d870d0..e5bfee9e1c218e69bee90f11f7c48e6e65e70d15 100644 --- a/src/shared/cplusplus/Scope.cpp +++ b/src/shared/cplusplus/Scope.cpp @@ -180,7 +180,7 @@ Symbol *SymbolTable::lookat(const Identifier *id) const const unsigned h = id->hashCode() % _hashSize; Symbol *symbol = _hash[h]; for (; symbol; symbol = symbol->_next) { - const Name *identity = symbol->identity(); + const Name *identity = symbol->unqualifiedName(); if (! identity) { continue; } else if (const NameId *nameId = identity->asNameId()) { @@ -210,7 +210,7 @@ Symbol *SymbolTable::lookat(int operatorId) const const unsigned h = operatorId % _hashSize; Symbol *symbol = _hash[h]; for (; symbol; symbol = symbol->_next) { - const Name *identity = symbol->identity(); + const Name *identity = symbol->unqualifiedName(); if (const OperatorNameId *op = identity->asOperatorNameId()) { if (op->kind() == operatorId) break; diff --git a/src/shared/cplusplus/Symbol.cpp b/src/shared/cplusplus/Symbol.cpp index c2fe64824429becc6c6281f8578b867a317f4e45..40d51c65cadd4dffc432862c2a0a0e65626eeeb5 100644 --- a/src/shared/cplusplus/Symbol.cpp +++ b/src/shared/cplusplus/Symbol.cpp @@ -199,7 +199,7 @@ const char *Symbol::fileName() const unsigned Symbol::fileNameLength() const { return fileId()->size(); } -const Name *Symbol::identity() const +const Name *Symbol::unqualifiedName() const { if (! _name) return 0; @@ -221,7 +221,7 @@ void Symbol::setName(const Name *name) _hashCode = 0; else { HashCode hh; - _hashCode = hh(identity()); + _hashCode = hh(unqualifiedName()); } } diff --git a/src/shared/cplusplus/Symbol.h b/src/shared/cplusplus/Symbol.h index 61c4e69b2dd49998dbbf5d96bf6d1cda1efb37b9..3781305fd9d0793d56377db96b849dd3aa7722ea 100644 --- a/src/shared/cplusplus/Symbol.h +++ b/src/shared/cplusplus/Symbol.h @@ -276,7 +276,7 @@ public: /// Returns this Symbol's index. unsigned index() const; - const Name *identity() const; + const Name *unqualifiedName() const; bool isGenerated() const; diff --git a/src/shared/cplusplus/Symbols.cpp b/src/shared/cplusplus/Symbols.cpp index a76d69468becee4da4c0d22d0a6ceb5cac0756b4..7dae77921796c37d1284c962fe6b2c1c684a232b 100644 --- a/src/shared/cplusplus/Symbols.cpp +++ b/src/shared/cplusplus/Symbols.cpp @@ -204,8 +204,8 @@ bool Function::isEqualTo(const Type *other) const return false; #endif - const Name *l = identity(); - const Name *r = o->identity(); + const Name *l = unqualifiedName(); + const Name *r = o->unqualifiedName(); if (l == r || (l && l->isEqualTo(r))) { if (argumentCount() != o->argumentCount()) return false; @@ -394,8 +394,8 @@ bool Enum::isEqualTo(const Type *other) const const Enum *o = other->asEnumType(); if (! o) return false; - const Name *l = identity(); - const Name *r = o->identity(); + const Name *l = unqualifiedName(); + const Name *r = o->unqualifiedName(); if (l == r) return true; else if (! l) @@ -492,8 +492,8 @@ bool Namespace::isEqualTo(const Type *other) const const Namespace *o = other->asNamespaceType(); if (! o) return false; - const Name *l = identity(); - const Name *r = o->identity(); + const Name *l = unqualifiedName(); + const Name *r = o->unqualifiedName(); if (l == r || (l && l->isEqualTo(r))) return true; return false; @@ -634,8 +634,8 @@ bool Class::isEqualTo(const Type *other) const const Class *o = other->asClassType(); if (! o) return false; - const Name *l = identity(); - const Name *r = o->identity(); + const Name *l = unqualifiedName(); + const Name *r = o->unqualifiedName(); if (l == r || (l && l->isEqualTo(r))) return true; else @@ -730,8 +730,8 @@ bool ObjCClass::isEqualTo(const Type *other) const if (!o) return false; - const Name *l = identity(); - const Name *r = o->identity(); + const Name *l = unqualifiedName(); + const Name *r = o->unqualifiedName(); if (l == r || (l && l->isEqualTo(r))) return true; else @@ -789,8 +789,8 @@ bool ObjCProtocol::isEqualTo(const Type *other) const if (!o) return false; - const Name *l = identity(); - const Name *r = o->identity(); + const Name *l = unqualifiedName(); + const Name *r = o->unqualifiedName(); if (l == r || (l && l->isEqualTo(r))) return true; else @@ -910,8 +910,8 @@ bool ObjCMethod::isEqualTo(const Type *other) const if (! o) return false; - const Name *l = identity(); - const Name *r = o->identity(); + const Name *l = unqualifiedName(); + const Name *r = o->unqualifiedName(); if (l == r || (l && l->isEqualTo(r))) { if (argumentCount() != o->argumentCount()) return false;