summaryrefslogtreecommitdiff
path: root/src/outputlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/outputlist.cpp')
-rw-r--r--src/outputlist.cpp57
1 files changed, 17 insertions, 40 deletions
diff --git a/src/outputlist.cpp b/src/outputlist.cpp
index c47c1c9..07d6491 100644
--- a/src/outputlist.cpp
+++ b/src/outputlist.cpp
@@ -1,12 +1,12 @@
/******************************************************************************
*
- *
+ *
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -33,7 +33,6 @@
OutputList::OutputList(bool)
{
//printf("OutputList::OutputList()\n");
- m_outputs.setAutoDelete(TRUE);
}
OutputList::~OutputList()
@@ -41,16 +40,14 @@ OutputList::~OutputList()
//printf("OutputList::~OutputList()\n");
}
-void OutputList::add(const OutputGenerator *og)
+void OutputList::add(OutputGenerator *og)
{
- if (og) m_outputs.append(og);
+ if (og) m_outputs.emplace_back(og);
}
void OutputList::disableAllBut(OutputGenerator::OutputType o)
{
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
og->disableIfNot(o);
}
@@ -58,9 +55,7 @@ void OutputList::disableAllBut(OutputGenerator::OutputType o)
void OutputList::enableAll()
{
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
og->enable();
}
@@ -68,9 +63,7 @@ void OutputList::enableAll()
void OutputList::disableAll()
{
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
og->disable();
}
@@ -78,9 +71,7 @@ void OutputList::disableAll()
void OutputList::disable(OutputGenerator::OutputType o)
{
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
og->disableIf(o);
}
@@ -88,9 +79,7 @@ void OutputList::disable(OutputGenerator::OutputType o)
void OutputList::enable(OutputGenerator::OutputType o)
{
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
og->enableIf(o);
}
@@ -99,9 +88,7 @@ void OutputList::enable(OutputGenerator::OutputType o)
bool OutputList::isEnabled(OutputGenerator::OutputType o)
{
bool result=FALSE;
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
result=result || og->isEnabled(o);
}
@@ -110,9 +97,7 @@ bool OutputList::isEnabled(OutputGenerator::OutputType o)
void OutputList::pushGeneratorState()
{
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
og->pushGeneratorState();
}
@@ -120,9 +105,7 @@ void OutputList::pushGeneratorState()
void OutputList::popGeneratorState()
{
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
og->popGeneratorState();
}
@@ -137,9 +120,7 @@ void OutputList::generateDoc(const char *fileName,int startLine,
int count=0;
if (docStr.isEmpty()) return;
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
if (og->isEnabled()) count++;
}
@@ -158,9 +139,7 @@ void OutputList::generateDoc(const char *fileName,int startLine,
void OutputList::writeDoc(DocRoot *root,const Definition *ctx,const MemberDef *md)
{
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
//printf("og->printDoc(extension=%s)\n",
// ctx?ctx->getDefFileExtension().data():"<null>");
@@ -172,9 +151,7 @@ void OutputList::writeDoc(DocRoot *root,const Definition *ctx,const MemberDef *m
void OutputList::parseText(const QCString &textStr)
{
int count=0;
- QListIterator<OutputGenerator> it(m_outputs);
- OutputGenerator *og;
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
if (og->isEnabled()) count++;
}
@@ -187,7 +164,7 @@ void OutputList::parseText(const QCString &textStr)
if (count>0)
{
- for (it.toFirst();(og=it.current());++it)
+ for (const auto &og : m_outputs)
{
if (og->isEnabled()) og->writeDoc(root,0,0);
}