forked from qt-creator/qt-creator
		
	Fix display of templates in outline.
Change-Id: I8b099c8234fac55ef0de17b014c89fbe02534bf4 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
		
				
					committed by
					
						
						Leandro Melo
					
				
			
			
				
	
			
			
			
						parent
						
							a68352f013
						
					
				
				
					commit
					9c7b96c663
				
			@@ -76,6 +76,10 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent)
 | 
			
		||||
        Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
 | 
			
		||||
        Q_ASSERT(parentSymbol);
 | 
			
		||||
 | 
			
		||||
        if (Template *t = parentSymbol->asTemplate())
 | 
			
		||||
            if (Symbol *templateParentSymbol = t->declaration())
 | 
			
		||||
                parentSymbol = templateParentSymbol;
 | 
			
		||||
 | 
			
		||||
        Scope *scope = parentSymbol->asScope();
 | 
			
		||||
        Q_ASSERT(scope != 0);
 | 
			
		||||
        return createIndex(row, 0, scope->memberAt(row));
 | 
			
		||||
@@ -89,6 +93,8 @@ QModelIndex OverviewModel::parent(const QModelIndex &child) const
 | 
			
		||||
        return QModelIndex();
 | 
			
		||||
 | 
			
		||||
    if (Scope *scope = symbol->enclosingScope()) {
 | 
			
		||||
        if (scope->isTemplate() && scope->enclosingScope())
 | 
			
		||||
            scope = scope->enclosingScope();
 | 
			
		||||
        if (scope->enclosingScope()) {
 | 
			
		||||
            QModelIndex index;
 | 
			
		||||
            if (scope->enclosingScope() && scope->enclosingScope()->enclosingScope()) // the parent doesn't have a parent
 | 
			
		||||
@@ -113,6 +119,10 @@ int OverviewModel::rowCount(const QModelIndex &parent) const
 | 
			
		||||
            Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
 | 
			
		||||
            Q_ASSERT(parentSymbol);
 | 
			
		||||
 | 
			
		||||
            if (Template *t = parentSymbol->asTemplate())
 | 
			
		||||
                if (Symbol *templateParentSymbol = t->declaration())
 | 
			
		||||
                    parentSymbol = templateParentSymbol;
 | 
			
		||||
 | 
			
		||||
            if (Scope *parentScope = parentSymbol->asScope()) {
 | 
			
		||||
                if (!parentScope->isFunction() && !parentScope->isObjCMethod()) {
 | 
			
		||||
                    return parentScope->memberCount();
 | 
			
		||||
@@ -168,6 +178,14 @@ QVariant OverviewModel::data(const QModelIndex &index, int role) const
 | 
			
		||||
        }
 | 
			
		||||
        if (symbol->isObjCPropertyDeclaration())
 | 
			
		||||
            name = QLatin1String("@property ") + name;
 | 
			
		||||
        if (Template *t = symbol->asTemplate())
 | 
			
		||||
            if (Symbol *templateDeclaration = t->declaration()) {
 | 
			
		||||
                QStringList parameters;
 | 
			
		||||
                for (unsigned i = 0; i < t->templateParameterCount(); ++i)
 | 
			
		||||
                    parameters.append(_overview.prettyName(t->templateParameterAt(i)->name()));
 | 
			
		||||
                name += QLatin1Char('<') + parameters.join(QLatin1String(", ")) + QLatin1Char('>');
 | 
			
		||||
                symbol = templateDeclaration;
 | 
			
		||||
            }
 | 
			
		||||
        if (symbol->isObjCMethod()) {
 | 
			
		||||
            ObjCMethod *method = symbol->asObjCMethod();
 | 
			
		||||
            if (method->isStatic())
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user