From 5eb4d23685e78b121d4827d5f9045ec69b5b9330 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 18 Jun 2009 01:55:04 -0400 Subject: [PATCH] Bug Fix - nag - TDB::gc now displays a header message. - nag function now piggy-backs on existing locked TDB. --- src/Context.cpp | 2 +- src/TDB.cpp | 4 ++++ src/recur.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 02ef8b8da..7791bce6d 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -509,7 +509,7 @@ void Context::parse ( // Reinitialize the context and recurse. initialize (); - parse (); + parse (args, cmd, task, sequence, subst, filter); } } } diff --git a/src/TDB.cpp b/src/TDB.cpp index 4e475c74e..cd5de6d68 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -196,6 +196,8 @@ int TDB::loadPending (std::vector & 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; diff --git a/src/recur.cpp b/src/recur.cpp index 37b009bba..2b2ceef7e 100644 --- a/src/recur.cpp +++ b/src/recur.cpp @@ -401,10 +401,10 @@ void nag (Task& task) { // Load all pending tasks. std::vector 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;