diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2010-07-28 19:05:01 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2010-07-28 19:05:01 (GMT) |
commit | 4ad0d24c5b3a0afd99722ae5c33968ff9fa44e2d (patch) | |
tree | aa81c2bd3e6109417a6bd30d6a58111d892f25f2 /src/dot.cpp | |
parent | c37c8626674dd6ba0d53dcad84dd4bb5d92005a4 (diff) | |
download | Doxygen-4ad0d24c5b3a0afd99722ae5c33968ff9fa44e2d.zip Doxygen-4ad0d24c5b3a0afd99722ae5c33968ff9fa44e2d.tar.gz Doxygen-4ad0d24c5b3a0afd99722ae5c33968ff9fa44e2d.tar.bz2 |
Release-1.7.1-20100728
Diffstat (limited to 'src/dot.cpp')
-rw-r--r-- | src/dot.cpp | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/src/dot.cpp b/src/dot.cpp index 58a8a84..3edbf18 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -535,9 +535,16 @@ bool DotRunner::run() QCString dotArgs; QListIterator<QCString> li(m_jobs); QCString *s; + QCString file = m_file; + QCString path = m_path; + QCString imageName = m_imageName; + QCString postCmd = m_postCmd; + QCString postArgs = m_postArgs; + bool checkResult = m_checkResult; + bool cleanUp = m_cleanUp; if (multiTargets) { - dotArgs="\""+m_file+"\""; + dotArgs="\""+file+"\""; for (li.toFirst();(s=li.current());++li) { dotArgs+=' '; @@ -552,23 +559,25 @@ bool DotRunner::run() { for (li.toFirst();(s=li.current());++li) { - dotArgs="\""+m_file+"\" "+*s; + dotArgs="\""+file+"\" "+*s; if ((exitCode=portable_system(dotExe,dotArgs,FALSE))!=0) { goto error; } } } - if (!m_postCmd.isEmpty() && portable_system(m_postCmd,m_postArgs)!=0) + if (!postCmd.isEmpty() && portable_system(postCmd,postArgs)!=0) { err("error: Problems running '%s' as a post-processing step for dot output\n",m_postCmd.data()); return FALSE; } - if (m_checkResult) checkDotResult(m_imageName); - if (m_cleanUp) + if (checkResult) checkDotResult(imageName); + if (cleanUp) { //printf("removing dot file %s\n",m_file.data()); - QDir(m_path).remove(m_file); + //QDir(path).remove(file); + m_cleanupItem.file = file; + m_cleanupItem.path = path; } return TRUE; error: @@ -721,6 +730,7 @@ uint DotRunnerQueue::count() const DotWorkerThread::DotWorkerThread(int id,DotRunnerQueue *queue) : m_id(id), m_queue(queue) { + m_cleanupItems.setAutoDelete(TRUE); } void DotWorkerThread::run() @@ -729,6 +739,21 @@ void DotWorkerThread::run() while ((runner=m_queue->dequeue())) { runner->run(); + DotRunner::CleanupItem cleanup = runner->cleanup(); + if (!cleanup.file.isEmpty()) + { + m_cleanupItems.append(new DotRunner::CleanupItem(cleanup)); + } + } +} + +void DotWorkerThread::cleanup() +{ + QListIterator<DotRunner::CleanupItem> it(m_cleanupItems); + DotRunner::CleanupItem *ci; + for (;(ci=it.current());++it) + { + QDir(ci->path).remove(ci->file); } } @@ -865,6 +890,11 @@ bool DotManager::run() { m_workers.at(i)->wait(); } + // clean up dot files from main thread + for (i=0;i<(int)m_workers.count();i++) + { + m_workers.at(i)->cleanup(); + } portable_sysTimerStop(); if (setPath) { @@ -3182,6 +3212,7 @@ void generateGraphLegend(const char *path) { removeDotGraph(absDotName); } + Doxygen::indexList.addImageFile(imgName); } |