Bug Fix - nag

- TDB::gc now displays a header message.
- nag function now piggy-backs on existing locked TDB.
This commit is contained in:
Paul Beckingham 2009-06-18 01:55:04 -04:00
parent b932d9b9b7
commit 5eb4d23685
3 changed files with 7 additions and 3 deletions

View file

@ -509,7 +509,7 @@ void Context::parse (
// Reinitialize the context and recurse.
initialize ();
parse ();
parse (args, cmd, task, sequence, subst, filter);
}
}
}

View file

@ -196,6 +196,8 @@ int TDB::loadPending (std::vector <Task>& tasks, Filter& filter)
try
{
mPending.clear ();
mId = 1;
char line[T_LINE_MAX];
foreach (location, mLocations)
@ -371,6 +373,8 @@ int TDB::gc ()
{
int count = 0;
context.header ("gc");
// Set up a second TDB.
Filter filter;
TDB tdb;

View file

@ -401,10 +401,10 @@ void nag (Task& task)
{
// Load all pending tasks.
std::vector <Task> tasks;
context.tdb.lock (context.config.get ("locking", true));
Filter filter;
// Piggy-back on existing locked TDB.
context.tdb.loadPending (tasks, filter);
context.tdb.unlock ();
// Counters.
int overdue = 0;