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. // Reinitialize the context and recurse.
initialize (); 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 try
{ {
mPending.clear ();
mId = 1; mId = 1;
char line[T_LINE_MAX]; char line[T_LINE_MAX];
foreach (location, mLocations) foreach (location, mLocations)
@ -371,6 +373,8 @@ int TDB::gc ()
{ {
int count = 0; int count = 0;
context.header ("gc");
// Set up a second TDB. // Set up a second TDB.
Filter filter; Filter filter;
TDB tdb; TDB tdb;

View file

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