CppTools: Fix qualified ids in the symbol searcher

The leaves in the treeview contained qualified ids.

Change-Id: I290eaf9b1e666b6879d6d4b1f2483cfe7fb85362
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-09-12 15:26:55 +02:00
parent 75b0429e29
commit 190fb44882
6 changed files with 72 additions and 37 deletions

View File

@@ -119,13 +119,19 @@ public:
foreach (const ModelItemInfo &info, modelInfos) {
int index = matcher.indexIn(info.symbolName);
if (index != -1) {
QString text = info.typeNameRepresentation();
if (text.isEmpty())
text = info.symbolName;
QString text = info.symbolName;
QString scope = info.symbolScope;
if (info.type == ModelItemInfo::Method) {
QString name;
info.unqualifiedNameAndScope(info.symbolName, &name, &scope);
text = name + info.symbolType;
} else if (info.type == ModelItemInfo::Declaration){
text = ModelItemInfo::representDeclaration(info.symbolName,
info.symbolType);
}
Find::SearchResultItem item;
item.path = info.symbolScope.split(QLatin1String("::"),
QString::SkipEmptyParts);
item.path = scope.split(QLatin1String("::"), QString::SkipEmptyParts);
item.text = text;
item.textMarkPos = -1;
item.textMarkLength = 0;