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