make TDB2.pending/completed non-public

References to methods on these fields are replaced with methods on TDB2,
several of which already existed.
This commit is contained in:
Dustin J. Mitchell
2022-04-01 23:20:57 +00:00
committed by Tomas Babej
parent 4ebd0ffb39
commit 271d06cd9c
11 changed files with 43 additions and 33 deletions

View File

@@ -81,7 +81,7 @@ int CmdCalendar::execute (std::string& output)
// Load the pending tasks.
handleUntil ();
handleRecurrence ();
auto tasks = Context::getContext ().tdb2.pending.get_tasks ();
auto tasks = Context::getContext ().tdb2.pending_tasks ();
Datetime today;
auto getPendingDate = false;

View File

@@ -202,7 +202,7 @@ void CmdContext::defineContext (const std::vector <std::string>& words, std::str
// Check if the value is a proper filter by filtering current pending.data
Filter filter;
std::vector <Task> filtered;
auto pending = Context::getContext ().tdb2.pending.get_tasks ();
auto pending = Context::getContext ().tdb2.pending_tasks ();
try
{

View File

@@ -60,10 +60,10 @@ int CmdProjects::execute (std::string& output)
// Get all the tasks.
handleUntil ();
handleRecurrence ();
auto tasks = Context::getContext ().tdb2.pending.get_tasks ();
auto tasks = Context::getContext ().tdb2.pending_tasks ();
if (Context::getContext ().config.getBoolean ("list.all.projects"))
for (auto& task : Context::getContext ().tdb2.completed.get_tasks ())
for (auto& task : Context::getContext ().tdb2.completed_tasks ())
tasks.push_back (task);
// Apply the filter.
@@ -172,10 +172,10 @@ int CmdCompletionProjects::execute (std::string& output)
// Get all the tasks.
handleUntil ();
handleRecurrence ();
auto tasks = Context::getContext ().tdb2.pending.get_tasks ();
auto tasks = Context::getContext ().tdb2.pending_tasks ();
if (Context::getContext ().config.getBoolean ("list.all.projects"))
for (auto& task : Context::getContext ().tdb2.completed.get_tasks ())
for (auto& task : Context::getContext ().tdb2.completed_tasks ())
tasks.push_back (task);
// Apply the filter.

View File

@@ -58,10 +58,10 @@ int CmdTags::execute (std::string& output)
std::stringstream out;
// Get all the tasks.
auto tasks = Context::getContext ().tdb2.pending.get_tasks ();
auto tasks = Context::getContext ().tdb2.pending_tasks ();
if (Context::getContext ().config.getBoolean ("list.all.tags"))
for (auto& task : Context::getContext ().tdb2.completed.get_tasks ())
for (auto& task : Context::getContext ().tdb2.completed_tasks ())
tasks.push_back (task);
int quantity = tasks.size ();
@@ -157,10 +157,10 @@ CmdCompletionTags::CmdCompletionTags ()
int CmdCompletionTags::execute (std::string& output)
{
// Get all the tasks.
auto tasks = Context::getContext ().tdb2.pending.get_tasks ();
auto tasks = Context::getContext ().tdb2.pending_tasks ();
if (Context::getContext ().config.getBoolean ("complete.all.tags"))
for (auto& task : Context::getContext ().tdb2.completed.get_tasks ())
for (auto& task : Context::getContext ().tdb2.completed_tasks ())
tasks.push_back (task);
// Apply filter.