Filter
- Generates debug message about filtering process.
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#include <Dates.h>
|
#include <Dates.h>
|
||||||
#include <Filter.h>
|
#include <Filter.h>
|
||||||
#include <i18n.h>
|
#include <i18n.h>
|
||||||
|
#include <text.h>
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
|
|
||||||
extern Context context;
|
extern Context context;
|
||||||
@@ -72,6 +73,8 @@ void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output
|
|||||||
{
|
{
|
||||||
context.timer_filter.start ();
|
context.timer_filter.start ();
|
||||||
|
|
||||||
|
_startCount = (int) input.size ();
|
||||||
|
|
||||||
if (context.config.getBoolean ("debug"))
|
if (context.config.getBoolean ("debug"))
|
||||||
{
|
{
|
||||||
Tree* t = context.parser.tree ();
|
Tree* t = context.parser.tree ();
|
||||||
@@ -109,6 +112,8 @@ void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output
|
|||||||
else
|
else
|
||||||
output = input;
|
output = input;
|
||||||
|
|
||||||
|
_endCount = (int) output.size ();
|
||||||
|
context.debug (format ("Filtered {1} tasks --> {2} tasks", _startCount, _endCount));
|
||||||
context.timer_filter.stop ();
|
context.timer_filter.stop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,6 +138,7 @@ void Filter::subset (std::vector <Task>& output)
|
|||||||
context.timer_filter.stop ();
|
context.timer_filter.stop ();
|
||||||
const std::vector <Task>& pending = context.tdb2.pending.get_tasks ();
|
const std::vector <Task>& pending = context.tdb2.pending.get_tasks ();
|
||||||
context.timer_filter.start ();
|
context.timer_filter.start ();
|
||||||
|
_startCount = (int) pending.size ();
|
||||||
|
|
||||||
Eval eval;
|
Eval eval;
|
||||||
eval.addSource (namedDates);
|
eval.addSource (namedDates);
|
||||||
@@ -163,6 +169,7 @@ void Filter::subset (std::vector <Task>& output)
|
|||||||
context.timer_filter.stop ();
|
context.timer_filter.stop ();
|
||||||
const std::vector <Task>& completed = context.tdb2.completed.get_tasks (); // TODO Optional
|
const std::vector <Task>& completed = context.tdb2.completed.get_tasks (); // TODO Optional
|
||||||
context.timer_filter.start ();
|
context.timer_filter.start ();
|
||||||
|
_startCount += (int) completed.size ();
|
||||||
|
|
||||||
for (task = completed.begin (); task != completed.end (); ++task)
|
for (task = completed.begin (); task != completed.end (); ++task)
|
||||||
{
|
{
|
||||||
@@ -193,6 +200,8 @@ void Filter::subset (std::vector <Task>& output)
|
|||||||
output.push_back (*task);
|
output.push_back (*task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_endCount = (int) output.size ();
|
||||||
|
context.debug (format ("Filtered {1} tasks --> {2} tasks", _startCount, _endCount));
|
||||||
context.timer_filter.stop ();
|
context.timer_filter.stop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user