mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-04 12:28:35 +02:00
TDB2
- Converted 'project' and '_projects' commands to TDB2.
This commit is contained in:
parent
72627268dc
commit
b05d4535f8
1 changed files with 19 additions and 16 deletions
|
@ -53,18 +53,20 @@ int CmdProjects::execute (std::string& output)
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
// Get all the tasks.
|
// Get all the tasks.
|
||||||
std::vector <Task> tasks;
|
|
||||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
|
||||||
handleRecurrence ();
|
handleRecurrence ();
|
||||||
|
std::vector <Task> tasks = context.tdb2.pending.get_tasks ();
|
||||||
|
|
||||||
int quantity;
|
|
||||||
if (context.config.getBoolean ("list.all.projects"))
|
if (context.config.getBoolean ("list.all.projects"))
|
||||||
quantity = context.tdb.load (tasks);
|
{
|
||||||
else
|
std::vector <Task> extra = context.tdb2.completed.get_tasks ();
|
||||||
quantity = context.tdb.loadPending (tasks);
|
std::vector <Task>::iterator task;
|
||||||
|
for (task = extra.begin (); task != extra.end (); ++task)
|
||||||
|
tasks.push_back (*task);
|
||||||
|
}
|
||||||
|
|
||||||
context.tdb.commit ();
|
int quantity = tasks.size ();
|
||||||
context.tdb.unlock ();
|
|
||||||
|
context.tdb2.commit ();
|
||||||
|
|
||||||
// Apply filter.
|
// Apply filter.
|
||||||
std::vector <Task> filtered;
|
std::vector <Task> filtered;
|
||||||
|
@ -162,17 +164,18 @@ CmdCompletionProjects::CmdCompletionProjects ()
|
||||||
int CmdCompletionProjects::execute (std::string& output)
|
int CmdCompletionProjects::execute (std::string& output)
|
||||||
{
|
{
|
||||||
// Get all the tasks.
|
// Get all the tasks.
|
||||||
std::vector <Task> tasks;
|
|
||||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
|
||||||
handleRecurrence ();
|
handleRecurrence ();
|
||||||
|
std::vector <Task> tasks = context.tdb2.pending.get_tasks ();
|
||||||
|
|
||||||
if (context.config.getBoolean ("complete.all.projects"))
|
if (context.config.getBoolean ("list.all.projects"))
|
||||||
context.tdb.load (tasks);
|
{
|
||||||
else
|
std::vector <Task> extra = context.tdb2.completed.get_tasks ();
|
||||||
context.tdb.loadPending (tasks);
|
std::vector <Task>::iterator task;
|
||||||
|
for (task = extra.begin (); task != extra.end (); ++task)
|
||||||
|
tasks.push_back (*task);
|
||||||
|
}
|
||||||
|
|
||||||
context.tdb.commit ();
|
context.tdb2.commit ();
|
||||||
context.tdb.unlock ();
|
|
||||||
|
|
||||||
// Apply filter.
|
// Apply filter.
|
||||||
std::vector <Task> filtered;
|
std::vector <Task> filtered;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue