forked from qt-creator/qt-creator
CppTools: Replace Method with Function
Change-Id: I6405c4dfa07eba1ea09ba23fe20667769eaca748 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
edddfba98a
commit
530332c255
@@ -130,7 +130,7 @@ public:
|
||||
if (index != -1) {
|
||||
QString text = info.symbolName;
|
||||
QString scope = info.symbolScope;
|
||||
if (info.type == ModelItemInfo::Method) {
|
||||
if (info.type == ModelItemInfo::Function) {
|
||||
QString name;
|
||||
info.unqualifiedNameAndScope(info.symbolName, &name, &scope);
|
||||
text = name + info.symbolType;
|
||||
|
||||
@@ -89,7 +89,7 @@ QList<Core::LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(QFutureInte
|
||||
QString matchString = info.symbolName;
|
||||
if (info.type == ModelItemInfo::Declaration)
|
||||
matchString = ModelItemInfo::representDeclaration(info.symbolName, info.symbolType);
|
||||
else if (info.type == ModelItemInfo::Method)
|
||||
else if (info.type == ModelItemInfo::Function)
|
||||
matchString += info.symbolType;
|
||||
|
||||
if ((hasWildcard && regexp.exactMatch(matchString))
|
||||
@@ -98,7 +98,7 @@ QList<Core::LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(QFutureInte
|
||||
QVariant id = qVariantFromValue(info);
|
||||
QString name = matchString;
|
||||
QString extraInfo = info.symbolScope;
|
||||
if (info.type == ModelItemInfo::Method) {
|
||||
if (info.type == ModelItemInfo::Function) {
|
||||
if (info.unqualifiedNameAndScope(matchString, &name, &extraInfo))
|
||||
name += info.symbolType;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ void CppLocatorData::flushPendingDocument(bool force)
|
||||
case ModelItemInfo::Class:
|
||||
resultsClasses.append(info);
|
||||
break;
|
||||
case ModelItemInfo::Method:
|
||||
case ModelItemInfo::Function:
|
||||
resultsFunctions.append(info);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -97,7 +97,7 @@ bool SearchSymbols::visit(Function *symbol)
|
||||
return false;
|
||||
QString name = symbolName(symbol);
|
||||
QString type = overview.prettyType(symbol->type());
|
||||
appendItem(name, type, _scope, ModelItemInfo::Method, symbol);
|
||||
appendItem(name, type, _scope, ModelItemInfo::Function, symbol);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ bool SearchSymbols::visit(Declaration *symbol)
|
||||
QString name = symbolName(symbol);
|
||||
QString type = overview.prettyType(symbol->type());
|
||||
appendItem(name, type, _scope,
|
||||
symbol->type()->asFunctionType() ? ModelItemInfo::Method
|
||||
symbol->type()->asFunctionType() ? ModelItemInfo::Function
|
||||
: ModelItemInfo::Declaration,
|
||||
symbol);
|
||||
return false;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace CppTools {
|
||||
|
||||
struct CPPTOOLS_EXPORT ModelItemInfo
|
||||
{
|
||||
enum ItemType { Enum, Class, Method, Declaration };
|
||||
enum ItemType { Enum, Class, Function, Declaration };
|
||||
|
||||
ModelItemInfo()
|
||||
: type(Declaration),
|
||||
|
||||
Reference in New Issue
Block a user