mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TDB2
- Converted 'stop' command to TDB2.
This commit is contained in:
parent
c72a556492
commit
77b647dfb0
1 changed files with 3 additions and 12 deletions
|
@ -54,14 +54,9 @@ int CmdStop::execute (std::string& output)
|
|||
int count = 0;
|
||||
std::stringstream out;
|
||||
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
context.tdb.loadPending (tasks);
|
||||
|
||||
// Apply filter.
|
||||
std::vector <Task> filtered;
|
||||
filter (tasks, filtered);
|
||||
|
||||
filter (filtered);
|
||||
if (filtered.size () == 0)
|
||||
{
|
||||
context.footnote (STRING_FEEDBACK_NO_TASKS_SP);
|
||||
|
@ -98,7 +93,7 @@ int CmdStop::execute (std::string& output)
|
|||
{
|
||||
if (permission.confirmed (before, taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
||||
{
|
||||
context.tdb.update (*task);
|
||||
context.tdb2.modify (*task);
|
||||
++count;
|
||||
|
||||
if (context.config.getBoolean ("echo.command"))
|
||||
|
@ -119,11 +114,7 @@ int CmdStop::execute (std::string& output)
|
|||
}
|
||||
}
|
||||
|
||||
if (count)
|
||||
context.tdb.commit ();
|
||||
|
||||
context.tdb.unlock ();
|
||||
|
||||
context.tdb2.commit ();
|
||||
output = out.str ();
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue