mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TDB2 Conversion
- Migrated several commands over to use TDB2. Have to start somewhere.
This commit is contained in:
parent
e573801517
commit
1dc2257156
8 changed files with 49 additions and 49 deletions
|
@ -50,17 +50,11 @@ CmdIDs::CmdIDs ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdIDs::execute (std::string& output)
|
||||
{
|
||||
// Scan the pending tasks, applying any filter.
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
handleRecurrence ();
|
||||
context.tdb.load (tasks);
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
// Apply filter.
|
||||
handleRecurrence ();
|
||||
std::vector <Task> filtered;
|
||||
filter (tasks, filtered);
|
||||
filter (filtered);
|
||||
context.tdb.commit ();
|
||||
|
||||
// Find number of matching tasks.
|
||||
std::vector <int> ids;
|
||||
|
@ -87,15 +81,11 @@ CmdCompletionIds::CmdCompletionIds ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionIds::execute (std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
context.tdb.loadPending (tasks);
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
// Apply filter.
|
||||
handleRecurrence ();
|
||||
std::vector <Task> filtered;
|
||||
filter (tasks, filtered);
|
||||
filter (filtered);
|
||||
context.tdb.commit ();
|
||||
|
||||
std::vector <int> ids;
|
||||
std::vector <Task>::iterator task;
|
||||
|
@ -128,15 +118,11 @@ CmdZshCompletionIds::CmdZshCompletionIds ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdZshCompletionIds::execute (std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
context.tdb.loadPending (tasks);
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
// Apply filter.
|
||||
handleRecurrence ();
|
||||
std::vector <Task> filtered;
|
||||
filter (tasks, filtered);
|
||||
filter (filtered);
|
||||
context.tdb.commit ();
|
||||
|
||||
std::stringstream out;
|
||||
std::vector <Task>::iterator task;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue