CppTools: Replace Method with Function

Change-Id: I6405c4dfa07eba1ea09ba23fe20667769eaca748
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Orgad Shaneh
2014-03-29 21:13:26 +03:00
committed by Orgad Shaneh
parent edddfba98a
commit 530332c255
6 changed files with 8 additions and 8 deletions

View File

@@ -112,7 +112,7 @@ void ClangSymbolSearcher::search(const QLinkedList<Symbol> &allSymbols)
case Symbol::Constructor: case Symbol::Constructor:
case Symbol::Destructor: case Symbol::Destructor:
if (m_parameters.types & SymbolSearcher::Functions) { if (m_parameters.types & SymbolSearcher::Functions) {
info.type = CppTools::ModelItemInfo::Method; info.type = CppTools::ModelItemInfo::Function;
break; break;
} else { } else {
continue; continue;

View File

@@ -130,7 +130,7 @@ public:
if (index != -1) { if (index != -1) {
QString text = info.symbolName; QString text = info.symbolName;
QString scope = info.symbolScope; QString scope = info.symbolScope;
if (info.type == ModelItemInfo::Method) { if (info.type == ModelItemInfo::Function) {
QString name; QString name;
info.unqualifiedNameAndScope(info.symbolName, &name, &scope); info.unqualifiedNameAndScope(info.symbolName, &name, &scope);
text = name + info.symbolType; text = name + info.symbolType;

View File

@@ -89,7 +89,7 @@ QList<Core::LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(QFutureInte
QString matchString = info.symbolName; QString matchString = info.symbolName;
if (info.type == ModelItemInfo::Declaration) if (info.type == ModelItemInfo::Declaration)
matchString = ModelItemInfo::representDeclaration(info.symbolName, info.symbolType); matchString = ModelItemInfo::representDeclaration(info.symbolName, info.symbolType);
else if (info.type == ModelItemInfo::Method) else if (info.type == ModelItemInfo::Function)
matchString += info.symbolType; matchString += info.symbolType;
if ((hasWildcard && regexp.exactMatch(matchString)) if ((hasWildcard && regexp.exactMatch(matchString))
@@ -98,7 +98,7 @@ QList<Core::LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(QFutureInte
QVariant id = qVariantFromValue(info); QVariant id = qVariantFromValue(info);
QString name = matchString; QString name = matchString;
QString extraInfo = info.symbolScope; QString extraInfo = info.symbolScope;
if (info.type == ModelItemInfo::Method) { if (info.type == ModelItemInfo::Function) {
if (info.unqualifiedNameAndScope(matchString, &name, &extraInfo)) if (info.unqualifiedNameAndScope(matchString, &name, &extraInfo))
name += info.symbolType; name += info.symbolType;
} }

View File

@@ -132,7 +132,7 @@ void CppLocatorData::flushPendingDocument(bool force)
case ModelItemInfo::Class: case ModelItemInfo::Class:
resultsClasses.append(info); resultsClasses.append(info);
break; break;
case ModelItemInfo::Method: case ModelItemInfo::Function:
resultsFunctions.append(info); resultsFunctions.append(info);
break; break;
default: default:

View File

@@ -97,7 +97,7 @@ bool SearchSymbols::visit(Function *symbol)
return false; return false;
QString name = symbolName(symbol); QString name = symbolName(symbol);
QString type = overview.prettyType(symbol->type()); QString type = overview.prettyType(symbol->type());
appendItem(name, type, _scope, ModelItemInfo::Method, symbol); appendItem(name, type, _scope, ModelItemInfo::Function, symbol);
return false; return false;
} }
@@ -130,7 +130,7 @@ bool SearchSymbols::visit(Declaration *symbol)
QString name = symbolName(symbol); QString name = symbolName(symbol);
QString type = overview.prettyType(symbol->type()); QString type = overview.prettyType(symbol->type());
appendItem(name, type, _scope, appendItem(name, type, _scope,
symbol->type()->asFunctionType() ? ModelItemInfo::Method symbol->type()->asFunctionType() ? ModelItemInfo::Function
: ModelItemInfo::Declaration, : ModelItemInfo::Declaration,
symbol); symbol);
return false; return false;

View File

@@ -50,7 +50,7 @@ namespace CppTools {
struct CPPTOOLS_EXPORT ModelItemInfo struct CPPTOOLS_EXPORT ModelItemInfo
{ {
enum ItemType { Enum, Class, Method, Declaration }; enum ItemType { Enum, Class, Function, Declaration };
ModelItemInfo() ModelItemInfo()
: type(Declaration), : type(Declaration),