- Renamed checkRecurring -> handleRecurrence

This commit is contained in:
Paul Beckingham 2008-07-06 03:04:54 -04:00
parent 947e65c1e2
commit 17152d8a46
2 changed files with 16 additions and 13 deletions

View file

@ -540,7 +540,7 @@ void handleList (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> tasks; std::vector <T> tasks;
tdb.allPendingT (tasks); tdb.allPendingT (tasks);
checkRecurring (tasks); handleRecurrence (tasks);
filter (tasks, task); filter (tasks, task);
initializeColorRules (conf); initializeColorRules (conf);
@ -685,7 +685,7 @@ void handleSmallList (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> tasks; std::vector <T> tasks;
tdb.allPendingT (tasks); tdb.allPendingT (tasks);
checkRecurring (tasks); handleRecurrence (tasks);
filter (tasks, task); filter (tasks, task);
initializeColorRules (conf); initializeColorRules (conf);
@ -1114,7 +1114,7 @@ void handleLongList (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> tasks; std::vector <T> tasks;
tdb.allPendingT (tasks); tdb.allPendingT (tasks);
checkRecurring (tasks); handleRecurrence (tasks);
filter (tasks, task); filter (tasks, task);
initializeColorRules (conf); initializeColorRules (conf);
@ -1273,7 +1273,7 @@ void handleReportSummary (const TDB& tdb, T& task, Config& conf)
std::map <std::string, bool> allProjects; std::map <std::string, bool> allProjects;
std::vector <T> pending; std::vector <T> pending;
tdb.allPendingT (pending); tdb.allPendingT (pending);
checkRecurring (pending); handleRecurrence (pending);
filter (pending, task); filter (pending, task);
for (unsigned int i = 0; i < pending.size (); ++i) for (unsigned int i = 0; i < pending.size (); ++i)
{ {
@ -1442,7 +1442,7 @@ void handleReportNext (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> pending; std::vector <T> pending;
tdb.allPendingT (pending); tdb.allPendingT (pending);
checkRecurring (pending); handleRecurrence (pending);
filter (pending, task); filter (pending, task);
// Restrict to matching subset. // Restrict to matching subset.
@ -1619,7 +1619,7 @@ void handleReportHistory (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> pending; std::vector <T> pending;
tdb.allPendingT (pending); tdb.allPendingT (pending);
checkRecurring (pending); handleRecurrence (pending);
filter (pending, task); filter (pending, task);
for (unsigned int i = 0; i < pending.size (); ++i) for (unsigned int i = 0; i < pending.size (); ++i)
{ {
@ -1813,7 +1813,7 @@ void handleReportGHistory (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> pending; std::vector <T> pending;
tdb.allPendingT (pending); tdb.allPendingT (pending);
checkRecurring (pending); handleRecurrence (pending);
filter (pending, task); filter (pending, task);
for (unsigned int i = 0; i < pending.size (); ++i) for (unsigned int i = 0; i < pending.size (); ++i)
{ {
@ -2002,6 +2002,7 @@ void handleReportGHistory (const TDB& tdb, T& task, Config& conf)
<< Text::colorize (Text::black, Text::on_yellow, "completed") << Text::colorize (Text::black, Text::on_yellow, "completed")
<< ", " << ", "
<< Text::colorize (Text::black, Text::on_red, "deleted") << Text::colorize (Text::black, Text::on_red, "deleted")
<< optionalBlankLine (conf)
<< std::endl; << std::endl;
else else
std::cout << "Legend: + added, X completed, - deleted" << std::endl; std::cout << "Legend: + added, X completed, - deleted" << std::endl;
@ -2212,7 +2213,7 @@ void handleReportCalendar (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> pending; std::vector <T> pending;
tdb.allPendingT (pending); tdb.allPendingT (pending);
checkRecurring (pending); handleRecurrence (pending);
filter (pending, task); filter (pending, task);
// Find the oldest pending due date. // Find the oldest pending due date.
@ -2532,7 +2533,7 @@ void handleReportOldest (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> tasks; std::vector <T> tasks;
tdb.allPendingT (tasks); tdb.allPendingT (tasks);
checkRecurring (tasks); handleRecurrence (tasks);
filter (tasks, task); filter (tasks, task);
initializeColorRules (conf); initializeColorRules (conf);
@ -2675,7 +2676,7 @@ void handleReportNewest (const TDB& tdb, T& task, Config& conf)
tdb.gc (); tdb.gc ();
std::vector <T> tasks; std::vector <T> tasks;
tdb.allPendingT (tasks); tdb.allPendingT (tasks);
checkRecurring (tasks); handleRecurrence (tasks);
filter (tasks, task); filter (tasks, task);
initializeColorRules (conf); initializeColorRules (conf);
@ -3492,7 +3493,7 @@ int getDueState (const std::string& due)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Scan for recurring tasks, and generate any necessary instances of those // Scan for recurring tasks, and generate any necessary instances of those
// tasks. // tasks.
void checkRecurring (std::vector <T>& tasks) void handleRecurrence (std::vector <T>& tasks)
{ {
std::vector <T> modified; std::vector <T> modified;
@ -3512,8 +3513,10 @@ void checkRecurring (std::vector <T>& tasks)
if (them->getAttribute ("parent") != "") if (them->getAttribute ("parent") != "")
children.push_back (*them); children.push_back (*them);
// TODO Determine if any new child tasks need to be generated. // TODO Determine if any new child tasks need to be generated, and do it.
// TODO if before "until" date, or "until" missing
// TODO Iterate from "due", incrementing by "recur"
} }
else else
modified.push_back (*it); modified.push_back (*it);

View file

@ -87,7 +87,7 @@ void handleModify (const TDB&, T&, Config&);
void handleColor (Config&); void handleColor (Config&);
void gatherNextTasks (const TDB&, T&, Config&, std::vector <T>&, std::vector <int>&); void gatherNextTasks (const TDB&, T&, Config&, std::vector <T>&, std::vector <int>&);
void nag (const TDB&, T&, Config&); void nag (const TDB&, T&, Config&);
void checkRecurring (std::vector <T>&); void handleRecurrence (std::vector <T>&);
// util.cpp // util.cpp
bool confirm (const std::string&); bool confirm (const std::string&);