- Converted 'denotate' command to TDB2.
This commit is contained in:
Paul Beckingham 2011-08-30 17:31:24 -04:00
parent ba5daece99
commit 965dabadf9

View file

@ -54,14 +54,9 @@ int CmdDenotate::execute (std::string& output)
int count = 0; int count = 0;
std::stringstream out; std::stringstream out;
std::vector <Task> tasks;
context.tdb.lock (context.config.getBoolean ("locking"));
context.tdb.loadPending (tasks);
// Apply filter. // Apply filter.
std::vector <Task> filtered; std::vector <Task> filtered;
filter (tasks, filtered); filter (filtered);
if (filtered.size () == 0) if (filtered.size () == 0)
{ {
context.footnote (STRING_FEEDBACK_NO_TASKS_SP); context.footnote (STRING_FEEDBACK_NO_TASKS_SP);
@ -128,7 +123,7 @@ int CmdDenotate::execute (std::string& output)
taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED)) taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
{ {
++count; ++count;
context.tdb.update (*task); context.tdb2.modify (*task);
if (context.config.getBoolean ("echo.command")) if (context.config.getBoolean ("echo.command"))
out << format (STRING_CMD_DENO_FOUND, anno) out << format (STRING_CMD_DENO_FOUND, anno)
<< "\n"; << "\n";
@ -139,11 +134,7 @@ int CmdDenotate::execute (std::string& output)
<< "\n"; << "\n";
} }
if (count) context.tdb2.commit ();
context.tdb.commit ();
context.tdb.unlock ();
output = out.str (); output = out.str ();
return rc; return rc;
} }