Skip to content

Commit

Permalink
Merge pull request #10098 from albert-github/feature/bug_formula_debug
Browse files Browse the repository at this point in the history
Possibility to see the temporary files used for formulas
  • Loading branch information
doxygen committed May 29, 2023
2 parents b5fe708 + d851a1d commit dfb8542
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ static std::map< std::string, Debug::DebugMask > s_labels =
{ "nolineno", Debug::NoLineNo },
{ "commentcnv", Debug::CommentCnv },
{ "commentscan", Debug::CommentScan },
{ "formula", Debug::Formula },
{ "printtree", Debug::PrintTree },
{ "time", Debug::Time },
{ "extcmd", Debug::ExtCmd },
Expand Down
1 change: 1 addition & 0 deletions src/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Debug
Preprocessor = 0x0001,
CommentCnv = 0x0002,
CommentScan = 0x0004,
Formula = 0x0008,
PrintTree = 0x0010,
Time = 0x0020,
ExtCmd = 0x0040,
Expand Down
9 changes: 3 additions & 6 deletions src/formula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,14 @@
#include "threadpool.h"
#include "portable.h"
#include "latexgen.h"
#include "debug.h"

// TODO: remove these dependencies
#include "doxygen.h" // for Doxygen::indexList
#include "indexlist.h" // for Doxygen::indexList

static int determineInkscapeVersion(const Dir &thisDir);

// Remove the temporary files
#define RM_TMP_FILES (true)
//#define RM_TMP_FILES (false)

struct FormulaManager::Private
{
LinkedMap<Formula> formulas;
Expand Down Expand Up @@ -663,7 +660,7 @@ void FormulaManager::generateImages(const QCString &path,Format format,HighDPI h
}

// clean up temporary files
if (RM_TMP_FILES)
if (!Debug::isFlagSet(Debug::Formula))
{
for (const auto &file : p->tempFiles)
{
Expand Down Expand Up @@ -761,7 +758,7 @@ static int determineInkscapeVersion(const Dir &thisDir)
{
return -1;
}
if (RM_TMP_FILES)
if (!Debug::isFlagSet(Debug::Formula))
{
thisDir.remove(inkscapeVersionFile.str());
}
Expand Down

0 comments on commit dfb8542

Please sign in to comment.