diff options
Diffstat (limited to 'src/groupdef.cpp')
-rw-r--r-- | src/groupdef.cpp | 79 |
1 files changed, 32 insertions, 47 deletions
diff --git a/src/groupdef.cpp b/src/groupdef.cpp index e1fab11..0d6d43f 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -396,15 +396,13 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly) (srcMd->getOuterScope()->definitionType()==Definition::TypeFile && md->getOuterScope()->definitionType()==Definition::TypeFile); - const ArgumentList *srcMdAl = srcMd->argumentList(); - const ArgumentList *mdAl = md->argumentList(); - const ArgumentList *tSrcMdAl = srcMd->templateArguments(); - const ArgumentList *tMdAl = md->templateArguments(); - + const ArgumentList &srcMdAl = srcMd->argumentList(); + const ArgumentList &mdAl = md->argumentList(); + const ArgumentList &tSrcMdAl = srcMd->templateArguments(); + const ArgumentList &tMdAl = md->templateArguments(); + if (srcMd->isFunction() && md->isFunction() && // both are a function - ((tSrcMdAl==0 && tMdAl==0) || - (tSrcMdAl!=0 && tMdAl!=0 && tSrcMdAl->count()==tMdAl->count()) - ) && // same number of template arguments + (tSrcMdAl.size()==tMdAl.size()) && // same number of template arguments matchArguments2(srcMd->getOuterScope(),srcMd->getFileDef(),srcMdAl, md->getOuterScope(),md->getFileDef(),mdAl, TRUE @@ -1460,14 +1458,12 @@ void GroupDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *current //---- helper functions ------------------------------------------------------ -void addClassToGroups(Entry *root,ClassDef *cd) +void addClassToGroups(const Entry *root,ClassDef *cd) { - QListIterator<Grouping> gli(*root->groups); - Grouping *g; - for (;(g=gli.current());++gli) + for (const Grouping &g : root->groups) { GroupDef *gd=0; - if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname))) + if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname))) { if (gd->addClass(cd)) { @@ -1478,16 +1474,14 @@ void addClassToGroups(Entry *root,ClassDef *cd) } } -void addNamespaceToGroups(Entry *root,NamespaceDef *nd) +void addNamespaceToGroups(const Entry *root,NamespaceDef *nd) { - //printf("root->groups->count()=%d\n",root->groups->count()); - QListIterator<Grouping> gli(*root->groups); - Grouping *g; - for (;(g=gli.current());++gli) + //printf("root->groups.size()=%d\n",root->groups.size()); + for (const Grouping &g : root->groups) { GroupDef *gd=0; //printf("group '%s'\n",s->data()); - if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname))) + if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname))) { if (gd->addNamespace(nd)) nd->makePartOfGroup(gd); //printf("Namespace %s: in group %s\n",nd->name().data(),s->data()); @@ -1495,16 +1489,14 @@ void addNamespaceToGroups(Entry *root,NamespaceDef *nd) } } -void addDirToGroups(Entry *root,DirDef *dd) +void addDirToGroups(const Entry *root,DirDef *dd) { - //printf("*** root->groups->count()=%d\n",root->groups->count()); - QListIterator<Grouping> gli(*root->groups); - Grouping *g; - for (;(g=gli.current());++gli) + //printf("*** root->groups.size()=%d\n",root->groups.size()); + for (const Grouping &g : root->groups) { GroupDef *gd=0; //printf("group '%s'\n",g->groupname.data()); - if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname))) + if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname))) { gd->addDir(dd); dd->makePartOfGroup(gd); @@ -1513,16 +1505,13 @@ void addDirToGroups(Entry *root,DirDef *dd) } } -void addGroupToGroups(Entry *root,GroupDef *subGroup) +void addGroupToGroups(const Entry *root,GroupDef *subGroup) { - //printf("addGroupToGroups for %s groups=%d\n",root->name.data(), - // root->groups?root->groups->count():-1); - QListIterator<Grouping> gli(*root->groups); - Grouping *g; - for (;(g=gli.current());++gli) + //printf("addGroupToGroups for %s groups=%d\n",root->name.data(),root->groups.size()); + for (const Grouping &g : root->groups) { GroupDef *gd=0; - if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname))) + if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname))) { if (gd==subGroup) { @@ -1544,24 +1533,22 @@ void addGroupToGroups(Entry *root,GroupDef *subGroup) } /*! Add a member to the group with the highest priority */ -void addMemberToGroups(Entry *root,MemberDef *md) +void addMemberToGroups(const Entry *root,MemberDef *md) { //printf("addMemberToGroups: Root %p = %s, md %p=%s groups=%d\n", // root, root->name.data(), md, md->name().data(), root->groups->count() ); - QListIterator<Grouping> gli(*root->groups); - Grouping *g; // Search entry's group list for group with highest pri. Grouping::GroupPri_t pri = Grouping::GROUPING_LOWEST; GroupDef *fgd=0; - for (;(g=gli.current());++gli) + for (const Grouping &g : root->groups) { GroupDef *gd=0; - if (!g->groupname.isEmpty() && - (gd=Doxygen::groupSDict->find(g->groupname)) && - g->pri >= pri) + if (!g.groupname.isEmpty() && + (gd=Doxygen::groupSDict->find(g.groupname)) && + g.pri >= pri) { - if (fgd && gd!=fgd && g->pri==pri) + if (fgd && gd!=fgd && g.pri==pri) { warn(root->fileName.data(), root->startLine, "Member %s found in multiple %s groups! " @@ -1572,7 +1559,7 @@ void addMemberToGroups(Entry *root,MemberDef *md) } fgd = gd; - pri = g->pri; + pri = g.pri; } } //printf("fgd=%p\n",fgd); @@ -1650,14 +1637,12 @@ void addMemberToGroups(Entry *root,MemberDef *md) } -void addExampleToGroups(Entry *root,PageDef *eg) +void addExampleToGroups(const Entry *root,PageDef *eg) { - QListIterator<Grouping> gli(*root->groups); - Grouping *g; - for (;(g=gli.current());++gli) + for (const Grouping &g : root->groups) { GroupDef *gd=0; - if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname))) + if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname))) { gd->addExample(eg); eg->makePartOfGroup(gd); @@ -1674,7 +1659,7 @@ QCString GroupDefImpl::getOutputFileBase() const void GroupDefImpl::addListReferences() { { - QList<ListItemInfo> *xrefItems = xrefListItems(); + const std::vector<ListItemInfo> &xrefItems = xrefListItems(); addRefItem(xrefItems, getOutputFileBase(), theTranslator->trGroup(TRUE,TRUE), |