From d501e9009b619fb7afcdd43be982c02c4663e29b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 30 Aug 2011 00:48:20 -0400 Subject: [PATCH] TDB2 - Converted the 'history', 'history.annual', 'ghistory' and 'ghistory.annual' commands to TDB2. --- src/commands/CmdHistory.cpp | 40 ++++++++----------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/src/commands/CmdHistory.cpp b/src/commands/CmdHistory.cpp index c3fafd89a..63f109869 100644 --- a/src/commands/CmdHistory.cpp +++ b/src/commands/CmdHistory.cpp @@ -58,16 +58,10 @@ int CmdHistoryMonthly::execute (std::string& output) std::map deletedGroup; // Deletions by month // Scan the pending tasks. - std::vector tasks; - context.tdb.lock (context.config.getBoolean ("locking")); handleRecurrence (); - context.tdb.load (tasks); - context.tdb.commit (); - context.tdb.unlock (); - - // Apply filter. std::vector filtered; - filter (tasks, filtered); + filter (filtered); + context.tdb2.commit (); std::vector ::iterator task; for (task = filtered.begin (); task != filtered.end (); ++task) @@ -218,16 +212,10 @@ int CmdHistoryAnnual::execute (std::string& output) std::map deletedGroup; // Deletions by month // Scan the pending tasks. - std::vector tasks; - context.tdb.lock (context.config.getBoolean ("locking")); handleRecurrence (); - context.tdb.load (tasks); - context.tdb.commit (); - context.tdb.unlock (); - - // Apply filter. std::vector filtered; - filter (tasks, filtered); + filter (filtered); + context.tdb2.commit (); std::vector ::iterator task; for (task = filtered.begin (); task != filtered.end (); ++task) @@ -375,16 +363,10 @@ int CmdGHistoryMonthly::execute (std::string& output) std::map deletedGroup; // Deletions by month // Scan the pending tasks. - std::vector tasks; - context.tdb.lock (context.config.getBoolean ("locking")); handleRecurrence (); - context.tdb.load (tasks); - context.tdb.commit (); - context.tdb.unlock (); - - // Apply filter. std::vector filtered; - filter (tasks, filtered); + filter (filtered); + context.tdb2.commit (); std::vector ::iterator task; for (task = filtered.begin (); task != filtered.end (); ++task) @@ -574,16 +556,10 @@ int CmdGHistoryAnnual::execute (std::string& output) std::map deletedGroup; // Deletions by month // Scan the pending tasks. - std::vector tasks; - context.tdb.lock (context.config.getBoolean ("locking")); handleRecurrence (); - context.tdb.load (tasks); - context.tdb.commit (); - context.tdb.unlock (); - - // Apply filter. std::vector filtered; - filter (tasks, filtered); + filter (filtered); + context.tdb2.commit (); std::vector ::iterator task; for (task = filtered.begin (); task != filtered.end (); ++task)