CppTools: Fix qualified ids in the ':' locator filter

* Always display qualified ids in the ':' filter
* Show correct qualified ids (for some symbols the namespace was shown
  twice)

Task-number: QTCREATORBUG-10136

Change-Id: Id178cb4b8abcc316250fa16e5f3e5a8e72bc0c10
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-09-12 14:06:36 +02:00
parent feef5cac4c
commit 91dbac0303
7 changed files with 90 additions and 43 deletions

View File

@@ -94,6 +94,18 @@ struct CPPTOOLS_EXPORT ModelItemInfo
: symbolScope + QLatin1String("::") + symbolName;
}
void unqualifiedNameAndScope(const QString &defaultName, QString *name, QString *scope) const
{
*name = defaultName;
*scope = symbolScope;
const QString qualifiedName = scopedSymbolName();
const int colonColonPosition = qualifiedName.lastIndexOf(QLatin1String("::"));
if (colonColonPosition != -1) {
*name = qualifiedName.mid(colonColonPosition + 2);
*scope = qualifiedName.left(colonColonPosition);
}
}
QString typeNameRepresentation() const
{
if (type == ModelItemInfo::Declaration) {
@@ -112,7 +124,7 @@ struct CPPTOOLS_EXPORT ModelItemInfo
QString shortNativeFilePath() const
{ return Utils::FileUtils::shortNativePath(Utils::FileName::fromString(fileName)); }
QString symbolName;
QString symbolName; // as found in the code, therefore might be qualified
QString symbolType;
QString symbolScope;
QString fileName;