diff options
author | Moritz 'Morty' Strübe <moritz.struebe@redheads.de> | 2020-03-19 19:01:31 (GMT) |
---|---|---|
committer | Moritz 'Morty' Strübe <moritz.struebe@redheads.de> | 2020-03-21 10:31:15 (GMT) |
commit | 00e79b8621b00f72ea56f81b1c4df9eae4ed9252 (patch) | |
tree | f390508aaaf334634a12926a2fde1d3d04762d5d /src | |
parent | e8f0640e7e80351de68b40b5114f71fe94dc5fee (diff) | |
download | Doxygen-00e79b8621b00f72ea56f81b1c4df9eae4ed9252.zip Doxygen-00e79b8621b00f72ea56f81b1c4df9eae4ed9252.tar.gz Doxygen-00e79b8621b00f72ea56f81b1c4df9eae4ed9252.tar.bz2 |
Replace qlist with std::vector
Diffstat (limited to 'src')
-rw-r--r-- | src/dotrunner.cpp | 36 | ||||
-rw-r--r-- | src/dotrunner.h | 4 |
2 files changed, 18 insertions, 22 deletions
diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp index a42c242..21967cb 100644 --- a/src/dotrunner.cpp +++ b/src/dotrunner.cpp @@ -151,22 +151,20 @@ DotRunner::DotRunner(const QCString& absDotName, const QCString& md5Hash) , m_dotExe(Config_getString(DOT_PATH)+"dot") , m_cleanUp(Config_getBool(DOT_CLEANUP)) { - m_jobs.setAutoDelete(TRUE); } void DotRunner::addJob(const char *format,const char *output) { - QListIterator<DotJob> li(m_jobs); - DotJob *s; - for (li.toFirst(); (s = li.current()); ++li) + + for (auto& s: m_jobs) { - if (qstrcmp(s->format.data(), format) != 0) continue; - if (qstrcmp(s->output.data(), output) != 0) continue; + if (qstrcmp(s.format.data(), format) != 0) continue; + if (qstrcmp(s.output.data(), output) != 0) continue; // we have this job already return; } QCString args = QCString("-T")+format+" -o \""+output+"\""; - m_jobs.append(new DotJob(format, output, args)); + m_jobs.emplace_back(format, output, args); } QCString getBaseNameOfOutput(QCString const& output) @@ -181,48 +179,46 @@ bool DotRunner::run() int exitCode=0; QCString dotArgs; - QListIterator<DotJob> li(m_jobs); - DotJob *s; // create output if (Config_getBool(DOT_MULTI_TARGETS)) { dotArgs=QCString("\"")+m_file.data()+"\""; - for (li.toFirst();(s=li.current());++li) + for (auto& s: m_jobs) { dotArgs+=' '; - dotArgs+=s->args.data(); + dotArgs+=s.args.data(); } if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error; } else { - for (li.toFirst();(s=li.current());++li) + for (auto& s : m_jobs) { - dotArgs=QCString("\"")+m_file.data()+"\" "+s->args.data(); + dotArgs=QCString("\"")+m_file.data()+"\" "+s.args.data(); if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error; } } // check output // As there should be only one pdf file be generated, we don't need code for regenerating multiple pdf files in one call - for (li.toFirst();(s=li.current());++li) + for (auto& s : m_jobs) { - if (qstrncmp(s->format.data(), "pdf", 3) == 0) + if (qstrncmp(s.format.data(), "pdf", 3) == 0) { int width=0,height=0; - if (!readBoundingBox(s->output.data(),&width,&height,FALSE)) goto error; + if (!readBoundingBox(s.output.data(),&width,&height,FALSE)) goto error; if ((width > MAX_LATEX_GRAPH_SIZE) || (height > MAX_LATEX_GRAPH_SIZE)) { - if (!resetPDFSize(width,height,getBaseNameOfOutput(s->output.data()))) goto error; - dotArgs=QCString("\"")+m_file.data()+"\" "+s->args.data(); + if (!resetPDFSize(width,height,getBaseNameOfOutput(s.output.data()))) goto error; + dotArgs=QCString("\"")+m_file.data()+"\" "+s.args.data(); if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error; } } - if (qstrncmp(s->format.data(), "png", 3) == 0) + if (qstrncmp(s.format.data(), "png", 3) == 0) { - checkPngResult(s->output.data()); + checkPngResult(s.output.data()); } } diff --git a/src/dotrunner.h b/src/dotrunner.h index 2fa0b61..052d5f7 100644 --- a/src/dotrunner.h +++ b/src/dotrunner.h @@ -17,8 +17,8 @@ #define DOTRUNNER_H #include "qcstring.h" -#include "qlist.h" #include "qthread.h" +#include <list> #include <queue> #include <mutex> @@ -101,7 +101,7 @@ class DotRunner DotConstString m_md5Hash; DotConstString m_dotExe; bool m_cleanUp; - QList<DotJob> m_jobs; + std::vector<DotJob> m_jobs; }; /** Queue of dot jobs to run. */ |