From dea9d3f4ef6fe229c37ad360ff82a36e36f54030 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 27 Apr 2014 12:49:54 -0700 Subject: [PATCH] Filter - rc.debug=1 propagates to Eval::debug. - Corrected comments. --- src/A3t.cpp | 3 ++- src/Filter.cpp | 6 ++++++ src/commands/CmdCount.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/A3t.cpp b/src/A3t.cpp index 7bc77fb39..bbee7972e 100644 --- a/src/A3t.cpp +++ b/src/A3t.cpp @@ -43,6 +43,7 @@ extern Context context; +// TODO Tie this to rc.abbreviation.minimum. static const int minimumMatchLength = 3; // Alias expansion limit. Any more indicates some kind of error. @@ -159,7 +160,7 @@ void A3t::entity (const std::string& name, const std::string& value) } //////////////////////////////////////////////////////////////////////////////// -// Search for 'value' in _entities, return category and canonicalized value. +// Search for 'value' in _entities category, return canonicalized value. bool A3t::canonicalize ( std::string& canonicalized, const std::string& category, diff --git a/src/Filter.cpp b/src/Filter.cpp index d98f9f576..b0bf516f4 100644 --- a/src/Filter.cpp +++ b/src/Filter.cpp @@ -92,6 +92,9 @@ void Filter::subset (const std::vector & input, std::vector & output eval.addSource (domSource); eval.compileExpression (filterExpr); + if (context.config.getBoolean ("debug")) + eval.debug (); + std::vector ::const_iterator task; for (task = input.begin (); task != input.end (); ++task) { @@ -144,6 +147,9 @@ void Filter::subset (std::vector & output) eval.addSource (domSource); eval.compileExpression (filterExpr); + if (context.config.getBoolean ("debug")) + eval.debug (); + output.clear (); std::vector ::const_iterator task; diff --git a/src/commands/CmdCount.cpp b/src/commands/CmdCount.cpp index 158cc587a..7bdabfac6 100644 --- a/src/commands/CmdCount.cpp +++ b/src/commands/CmdCount.cpp @@ -49,8 +49,8 @@ int CmdCount::execute (std::string& output) { // Apply filter. handleRecurrence (); - std::vector filtered; Filter filter; + std::vector filtered; filter.subset (filtered); context.tdb2.commit ();