summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Hebbeker <david@hebbeker.info>2020-04-26 10:05:38 (GMT)
committerDavid Hebbeker <david@hebbeker.info>2020-05-02 17:03:34 (GMT)
commit534cf6a4f2098e96b15bb49f41d93d6e991bd3f9 (patch)
treea5f695f91af051d24d6a4c15380bf5707274bfce /src
parent8ef8e3cdd322994a262a937b4b52a3fb6e6774dd (diff)
downloadDoxygen-534cf6a4f2098e96b15bb49f41d93d6e991bd3f9.zip
Doxygen-534cf6a4f2098e96b15bb49f41d93d6e991bd3f9.tar.gz
Doxygen-534cf6a4f2098e96b15bb49f41d93d6e991bd3f9.tar.bz2
For loops on QListIterator by range loops.
(cherry picked from commit 3a90e663f701e7f414d31d54264ce66d62c17976)
Diffstat (limited to 'src')
-rw-r--r--src/context.cpp13
-rw-r--r--src/dirdef.cpp10
-rw-r--r--src/dotdirdeps.cpp8
-rw-r--r--src/dotgroupcollaboration.cpp4
-rw-r--r--src/groupdef.cpp8
-rw-r--r--src/index.cpp12
-rw-r--r--src/xmlgen.cpp4
7 files changed, 16 insertions, 43 deletions
diff --git a/src/context.cpp b/src/context.cpp
index 53b63f9..55d6c6c 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -3532,10 +3532,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private>
if (!cache.dirs)
{
cache.dirs.reset(TemplateList::alloc());
- const DirList &subDirs = m_dirDef->subDirs();
- QListIterator<DirDef> it(subDirs);
- const DirDef *dd;
- for (it.toFirst();(dd=it.current());++it)
+ for(const auto dd : m_dirDef->subDirs())
{
DirContext *dc = new DirContext(dd);
cache.dirs->append(dc);
@@ -5465,9 +5462,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
TemplateList *dirList = TemplateList::alloc();
if (m_groupDef->getDirs())
{
- QListIterator<DirDef> it(*m_groupDef->getDirs());
- const DirDef *dd;
- for (it.toFirst();(dd=it.current());++it)
+ for(const auto dd : *(m_groupDef->getDirs()))
{
dirList->append(DirContext::alloc(dd));
}
@@ -6599,9 +6594,7 @@ class NestingContext::Private : public GenericNodeListContext
}
void addDirs(const DirList &dirList)
{
- QListIterator<DirDef> li(dirList);
- const DirDef *dd;
- for (li.toFirst();(dd=li.current());++li)
+ for(const auto dd : dirList)
{
append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE,FALSE,FALSE));
m_index++;
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 70ca3c0..3a13b0a 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -307,9 +307,7 @@ void DirDefImpl::writeDirectoryGraph(OutputList &ol)
void DirDefImpl::writeSubDirList(OutputList &ol)
{
int numSubdirs = 0;
- QListIterator<DirDef> it(m_subdirs);
- DirDef *dd;
- for (it.toFirst();(dd=it.current());++it)
+ for(const auto dd : m_subdirs)
{
if (dd->hasDocumentation() || dd->getFiles()->count()>0)
{
@@ -324,7 +322,7 @@ void DirDefImpl::writeSubDirList(OutputList &ol)
ol.parseText(theTranslator->trDir(TRUE,FALSE));
ol.endMemberHeader();
ol.startMemberList();
- for (it.toFirst();(dd=it.current());++it)
+ for(const auto dd : m_subdirs)
{
if (dd->hasDocumentation() || dd->getFiles()->count()==0)
{
@@ -462,9 +460,7 @@ void DirDefImpl::writeTagFile(FTextStream &tagFile)
{
if (m_subdirs.count()>0)
{
- DirDef *dd;
- QListIterator<DirDef> it(m_subdirs);
- for (;(dd=it.current());++it)
+ for(const auto dd : m_subdirs)
{
tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl;
}
diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp
index 66a68df..c0e4712 100644
--- a/src/dotdirdeps.cpp
+++ b/src/dotdirdeps.cpp
@@ -55,11 +55,9 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
<< dd->shortName() << "\"];\n";
// add nodes for sub directories
- QListIterator<DirDef> sdi(dd->subDirs());
- const DirDef *sdir;
- for (sdi.toFirst();(sdir=sdi.current());++sdi)
+ for(const auto sdir : dd->subDirs())
{
- t << " " << sdir->getOutputFileBase() << " [shape=box label=\""
+ t << " " << sdir->getOutputFileBase() << " [shape=box label=\""
<< sdir->shortName() << "\"";
if (sdir->isCluster())
{
@@ -70,7 +68,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
t << " color=\"black\"";
}
t << " fillcolor=\"white\" style=\"filled\"";
- t << " URL=\"" << sdir->getOutputFileBase()
+ t << " URL=\"" << sdir->getOutputFileBase()
<< Doxygen::htmlFileExtension << "\"";
t << "];\n";
dirsInGraph.insert(sdir->getOutputFileBase(),sdir);
diff --git a/src/dotgroupcollaboration.cpp b/src/dotgroupcollaboration.cpp
index 0a56460..ef04e8f 100644
--- a/src/dotgroupcollaboration.cpp
+++ b/src/dotgroupcollaboration.cpp
@@ -165,9 +165,7 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
// Add directories
if ( gd->getDirs() && gd->getDirs()->count() )
{
- QListIterator<DirDef> defli(*gd->getDirs());
- const DirDef *def;
- for (;(def=defli.current());++defli)
+ for(const auto def : *(gd->getDirs()))
{
tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension;
addCollaborationMember( def, tmp_url, DotGroupCollaboration::tdir );
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index 90de94b..3e95afc 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -782,9 +782,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
{
if (m_dirList)
{
- QListIterator<DirDef> it(*m_dirList);
- DirDef *dd;
- for (;(dd=it.current());++it)
+ for(const auto dd : *m_dirList)
{
if (dd->isLinkableInProject())
{
@@ -1055,9 +1053,7 @@ void GroupDefImpl::writeDirs(OutputList &ol,const QCString &title)
ol.parseText(title);
ol.endMemberHeader();
ol.startMemberList();
- QListIterator<DirDef> it(*m_dirList);
- DirDef *dd;
- for (;(dd=it.current());++it)
+ for(const auto dd : *m_dirList)
{
if (!dd->hasDocumentation()) continue;
ol.startMemberDeclaration();
diff --git a/src/index.cpp b/src/index.cpp
index fd61a45..698470d 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -587,9 +587,7 @@ static bool dirHasVisibleChildren(DirDef *dd)
}
}
- QListIterator<DirDef> dli(dd->subDirs());
- DirDef *subdd;
- for (dli.toFirst();(subdd=dli.current());++dli)
+ for(const auto subdd : dd->subDirs())
{
if (dirHasVisibleChildren(subdd))
{
@@ -649,9 +647,7 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv
if (dd->subDirs().count()>0)
{
startIndexHierarchy(ol,level+1);
- QListIterator<DirDef> dli(dd->subDirs());
- DirDef *subdd = 0;
- for (dli.toFirst();(subdd=dli.current());++dli)
+ for(const auto subdd : dd->subDirs())
{
writeDirTreeNode(ol,subdd,level+1,ftv,addToIndex);
}
@@ -4125,9 +4121,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp*
}
else if (lde->kind()==LayoutDocEntry::GroupDirs && addToIndex)
{
- QListIterator<DirDef> it(*gd->getDirs());
- DirDef *dd;
- for (;(dd=it.current());++it)
+ for(const auto dd : *(gd->getDirs()))
{
if (dd->isVisible())
{
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 445916f..b8d645a 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -1214,9 +1214,7 @@ static void writeInnerDirs(const DirList *dl,FTextStream &t)
{
if (dl)
{
- QListIterator<DirDef> subdirs(*dl);
- DirDef *subdir;
- for (subdirs.toFirst();(subdir=subdirs.current());++subdirs)
+ for(const auto subdir : *dl)
{
t << " <innerdir refid=\"" << subdir->getOutputFileBase()
<< "\">" << convertToXML(subdir->displayName()) << "</innerdir>" << endl;