From 965dabadf9395ea5fc072d75d9e2d66321ce93e3 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 30 Aug 2011 17:31:24 -0400 Subject: [PATCH] TDB2 - Converted 'denotate' command to TDB2. --- src/commands/CmdDenotate.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/commands/CmdDenotate.cpp b/src/commands/CmdDenotate.cpp index 4a0101a98..12ee03273 100644 --- a/src/commands/CmdDenotate.cpp +++ b/src/commands/CmdDenotate.cpp @@ -54,14 +54,9 @@ int CmdDenotate::execute (std::string& output) int count = 0; std::stringstream out; - std::vector tasks; - context.tdb.lock (context.config.getBoolean ("locking")); - context.tdb.loadPending (tasks); - // Apply filter. std::vector filtered; - filter (tasks, filtered); - + filter (filtered); if (filtered.size () == 0) { context.footnote (STRING_FEEDBACK_NO_TASKS_SP); @@ -128,7 +123,7 @@ int CmdDenotate::execute (std::string& output) taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED)) { ++count; - context.tdb.update (*task); + context.tdb2.modify (*task); if (context.config.getBoolean ("echo.command")) out << format (STRING_CMD_DENO_FOUND, anno) << "\n"; @@ -139,11 +134,7 @@ int CmdDenotate::execute (std::string& output) << "\n"; } - if (count) - context.tdb.commit (); - - context.tdb.unlock (); - + context.tdb2.commit (); output = out.str (); return rc; }