From 402f1f1b41c0e1622c88420e2656c8bf485d9b7a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 30 Aug 2011 17:30:12 -0400 Subject: [PATCH] TDB2 - Converted 'annotate' to TDB2. --- src/commands/CmdAnnotate.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/commands/CmdAnnotate.cpp b/src/commands/CmdAnnotate.cpp index b7c40b7b7..28e2eb68c 100644 --- a/src/commands/CmdAnnotate.cpp +++ b/src/commands/CmdAnnotate.cpp @@ -54,14 +54,9 @@ int CmdAnnotate::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); @@ -93,7 +88,7 @@ int CmdAnnotate::execute (std::string& output) taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED)) { - context.tdb.update (*task); + context.tdb2.modify (*task); ++count; if (context.config.getBoolean ("echo.command")) @@ -105,10 +100,7 @@ int CmdAnnotate::execute (std::string& output) } } - if (count) - context.tdb.commit (); - - context.tdb.unlock (); + context.tdb2.commit (); if (context.config.getBoolean ("echo.command")) out << format ((count == 1