mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TDB2
- Converted 'edit' command to TDB2.
This commit is contained in:
parent
7f1e517754
commit
9fefd4f283
1 changed files with 4 additions and 10 deletions
|
@ -56,24 +56,18 @@ int CmdEdit::execute (std::string& output)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
// Get all the tasks.
|
// Filter the tasks.
|
||||||
std::vector <Task> tasks;
|
|
||||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
|
||||||
handleRecurrence ();
|
handleRecurrence ();
|
||||||
context.tdb.load (tasks);
|
|
||||||
|
|
||||||
// Apply filter.
|
|
||||||
std::vector <Task> filtered;
|
std::vector <Task> filtered;
|
||||||
filter (tasks, filtered);
|
filter (filtered);
|
||||||
|
|
||||||
// Find number of matching tasks. Skip recurring parent tasks.
|
// Find number of matching tasks. Skip recurring parent tasks.
|
||||||
std::vector <Task>::iterator task;
|
std::vector <Task>::iterator task;
|
||||||
for (task = filtered.begin (); task != filtered.end (); ++task)
|
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||||
if (editFile (*task))
|
if (editFile (*task))
|
||||||
context.tdb.update (*task);
|
context.tdb2.modify (*task);
|
||||||
|
|
||||||
context.tdb.commit ();
|
context.tdb2.commit ();
|
||||||
context.tdb.unlock ();
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue