mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TDB2
- Converted 'duplicate' to TDB2.
This commit is contained in:
parent
90404c287e
commit
f07ea0a26a
1 changed files with 3 additions and 12 deletions
|
@ -54,14 +54,9 @@ int CmdDuplicate::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);
|
||||||
|
@ -100,7 +95,7 @@ int CmdDuplicate::execute (std::string& output)
|
||||||
// Only allow valid tasks.
|
// Only allow valid tasks.
|
||||||
dup.validate ();
|
dup.validate ();
|
||||||
|
|
||||||
context.tdb.add (dup);
|
context.tdb2.add (dup);
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
if (context.config.getBoolean ("echo.command"))
|
if (context.config.getBoolean ("echo.command"))
|
||||||
|
@ -116,13 +111,9 @@ int CmdDuplicate::execute (std::string& output)
|
||||||
context.footnote (onProjectChange (dup));
|
context.footnote (onProjectChange (dup));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count)
|
|
||||||
context.tdb.commit ();
|
|
||||||
|
|
||||||
context.tdb.unlock ();
|
|
||||||
|
|
||||||
// TODO Add count summary, like the 'done' command.
|
// TODO Add count summary, like the 'done' command.
|
||||||
|
|
||||||
|
context.tdb2.commit ();
|
||||||
output = out.str ();
|
output = out.str ();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue