Fixed semantic checks for Objective-C methods and fast-enumeration.

This commit is contained in:
Erik Verbruggen
2009-08-05 18:30:18 +02:00
parent ca34b0ca1c
commit 86a7b26fcd
17 changed files with 277 additions and 32 deletions

View File

@@ -102,6 +102,8 @@ QIcon Icons::iconForSymbol(const Symbol *symbol) const
return _classIcon;
} else if (symbol->isObjCProtocol() || symbol->isObjCForwardProtocolDeclaration()) {
return _classIcon;
} else if (symbol->isObjCMethod()) {
return _funcPublicIcon;
} else if (symbol->isNamespace()) {
return _namespaceIcon;
} else if (symbol->isUsingNamespaceDirective() ||

View File

@@ -123,7 +123,7 @@ int OverviewModel::rowCount(const QModelIndex &parent) const
Q_ASSERT(parentSymbol);
if (ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol()) {
if (!scopedSymbol->isFunction()) {
if (!scopedSymbol->isFunction() && !scopedSymbol->isObjCMethod()) {
Scope *parentScope = scopedSymbol->members();
Q_ASSERT(parentScope);
@@ -168,9 +168,23 @@ QVariant OverviewModel::data(const QModelIndex &index, int role) const
name = QLatin1String("@class ") + name;
if (symbol->isObjCForwardProtocolDeclaration() || symbol->isObjCProtocol())
name = QLatin1String("@protocol ") + name;
if (symbol->isObjCClass())
name = QLatin1String("@interface ") + name;
if (! symbol->isScopedSymbol() || symbol->isFunction()) {
if (symbol->isObjCClass()) {
ObjCClass *clazz = symbol->asObjCClass();
if (clazz->isInterface())
name = QLatin1String("@interface ") + name;
else
name = QLatin1String("@implementation ") + name;
if (clazz->isCategory())
name += QLatin1String(" (") + _overview.prettyName(clazz->categoryName()) + QLatin1Char(')');
}
if (symbol->isObjCMethod()) {
ObjCMethod *method = symbol->asObjCMethod();
if (method->isStatic())
name = QLatin1Char('+') + name;
else
name = QLatin1Char('-') + name;
} else if (! symbol->isScopedSymbol() || symbol->isFunction()) {
QString type = _overview.prettyType(symbol->type());
if (! type.isEmpty()) {
if (! symbol->type()->isFunctionType())