static void typedefMap( QMap<QString, QString> & map, NamespaceDom ns ) { const TypeAliasList aliasList = ns->typeAliasList(); for( TypeAliasList::ConstIterator it=aliasList.begin(); it!=aliasList.end(); ++it ) map[ ( *it )->name() ] = ( *it )->type(); const NamespaceList namespaceList = ns->namespaceList(); for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it ) typedefMap( map, *it ); const ClassList classList = ns->classList(); for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it ) typedefMap( map, *it ); }
void refreshNamespaces(ClassViewPart *part, KComboView *view) { view->clear(); NamespaceItem *global_item = new NamespaceItem( part, view->listView(), i18n("(Global Namespace)"), part->codeModel()->globalNamespace() ); view->addItem(global_item); global_item->setPixmap( 0, UserIcon("CVnamespace", KIcon::DefaultState, part->instance()) ); NamespaceList namespaces = part->codeModel()->globalNamespace()->namespaceList(); for (NamespaceList::const_iterator it = namespaces.begin(); it != namespaces.end(); ++it) { NamespaceItem *item = new NamespaceItem(part, view->listView(), part->languageSupport()->formatModelItem(*it), *it); view->addItem(item); item->setOpen(true); } view->setCurrentActiveItem(global_item); }
static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns ) { if( !ns->isFile() ) path.push_back( ns->name() ); const NamespaceList namespaceList = ns->namespaceList(); for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it ) typeNameList( path, lst, *it ); const ClassList classList = ns->classList(); for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it ) typeNameList( path, lst, *it ); if( !ns->isFile() ) path.pop_back(); }
NamespaceDom ViewCombosOp::namespaceByName( NamespaceDom dom, QString name ) { NamespaceDom result; result = dom->namespaceByName(name); if (!result) { NamespaceList nslist = dom->namespaceList(); for (NamespaceList::const_iterator it = nslist.begin(); it != nslist.end(); ++it) { result = namespaceByName(*it, name); if (result) break; } } return result; }