Commit 8d6ea451 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Show function args in current document filter

Regression introduced by commit 190fb448.

Change-Id: Ibd47b6d316e5ae976fb448aad5062eb5887f10e6
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 4979e8ad
......@@ -98,8 +98,10 @@ QList<Locator::FilterEntry> CppCurrentDocumentFilter::matchesFor(QFutureInterfac
QVariant id = qVariantFromValue(info);
QString name = matchString;
QString extraInfo = info.symbolScope;
if (info.type == ModelItemInfo::Method)
info.unqualifiedNameAndScope(matchString, &name, &extraInfo);
if (info.type == ModelItemInfo::Method) {
if (info.unqualifiedNameAndScope(matchString, &name, &extraInfo))
name += info.symbolType;
}
Locator::FilterEntry filterEntry(this, name, id, info.icon);
filterEntry.extraInfo = extraInfo;
......
......@@ -252,35 +252,35 @@ void CppToolsPlugin::test_cpplocatorfilters_CppCurrentDocumentFilter()
<< ResultData(_("int V1"), _("MyEnum"))
<< ResultData(_("int V2"), _("MyEnum"))
<< ResultData(_("MyClass"), _(""))
<< ResultData(_("MyClass"), _("MyClass"))
<< ResultData(_("functionDeclaredOnly"), _("MyClass"))
<< ResultData(_("functionDefinedInClass"), _("MyClass"))
<< ResultData(_("functionDefinedOutSideClass"), _("MyClass"))
<< ResultData(_("functionDefinedOutSideClass"), _("MyClass"))
<< ResultData(_("MyClass()"), _("MyClass"))
<< ResultData(_("functionDeclaredOnly()"), _("MyClass"))
<< ResultData(_("functionDefinedInClass(bool, int)"), _("MyClass"))
<< ResultData(_("functionDefinedOutSideClass(char)"), _("MyClass"))
<< ResultData(_("functionDefinedOutSideClass(char)"), _("MyClass"))
<< ResultData(_("int myVariable"), _("MyNamespace"))
<< ResultData(_("myFunction"), _("MyNamespace"))
<< ResultData(_("myFunction(bool, int)"), _("MyNamespace"))
<< ResultData(_("MyEnum"), _("MyNamespace"))
<< ResultData(_("int V1"), _("MyNamespace::MyEnum"))
<< ResultData(_("int V2"), _("MyNamespace::MyEnum"))
<< ResultData(_("MyClass"), _("MyNamespace"))
<< ResultData(_("MyClass"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDeclaredOnly"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedInClass"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedOutSideClass"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedOutSideClassAndNamespace"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedOutSideClass"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedOutSideClassAndNamespace"), _("MyNamespace::MyClass"))
<< ResultData(_("MyClass()"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDeclaredOnly()"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedInClass(bool, int)"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedOutSideClass(char)"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedOutSideClassAndNamespace(float)"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedOutSideClass(char)"), _("MyNamespace::MyClass"))
<< ResultData(_("functionDefinedOutSideClassAndNamespace(float)"), _("MyNamespace::MyClass"))
<< ResultData(_("int myVariable"), _("<anonymous namespace>"))
<< ResultData(_("myFunction"), _("<anonymous namespace>"))
<< ResultData(_("myFunction(bool, int)"), _("<anonymous namespace>"))
<< ResultData(_("MyEnum"), _("<anonymous namespace>"))
<< ResultData(_("int V1"), _("<anonymous namespace>::MyEnum"))
<< ResultData(_("int V2"), _("<anonymous namespace>::MyEnum"))
<< ResultData(_("MyClass"), _("<anonymous namespace>"))
<< ResultData(_("MyClass"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("functionDeclaredOnly"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("functionDefinedInClass"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("functionDefinedOutSideClass"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("functionDefinedOutSideClass"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("MyClass()"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("functionDeclaredOnly()"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("functionDefinedInClass(bool, int)"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("functionDefinedOutSideClass(char)"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("functionDefinedOutSideClass(char)"), _("<anonymous namespace>::MyClass"))
<< ResultData(_("main()"), _(""))
;
......
......@@ -94,7 +94,7 @@ struct CPPTOOLS_EXPORT ModelItemInfo
: symbolScope + QLatin1String("::") + symbolName;
}
void unqualifiedNameAndScope(const QString &defaultName, QString *name, QString *scope) const
bool unqualifiedNameAndScope(const QString &defaultName, QString *name, QString *scope) const
{
*name = defaultName;
*scope = symbolScope;
......@@ -103,7 +103,9 @@ struct CPPTOOLS_EXPORT ModelItemInfo
if (colonColonPosition != -1) {
*name = qualifiedName.mid(colonColonPosition + 2);
*scope = qualifiedName.left(colonColonPosition);
return true;
}
return false;
}
static QString representDeclaration(const QString &name, const QString &type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment