mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Revive TDB2::has and TF2::has methods
This reverts commit fa920f02aa
. Methods
found their usage after all.
This commit is contained in:
parent
2d25cf6f59
commit
22368b9a40
2 changed files with 23 additions and 0 deletions
21
src/TDB2.cpp
21
src/TDB2.cpp
|
@ -149,6 +149,19 @@ bool TF2::get (const std::string& uuid, Task& task)
|
|||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool TF2::has (const std::string& uuid)
|
||||
{
|
||||
if (! _loaded_tasks)
|
||||
load_tasks ();
|
||||
|
||||
for (auto& i : _tasks)
|
||||
if (i.get ("uuid") == uuid)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TF2::add_task (Task& task)
|
||||
{
|
||||
|
@ -1350,6 +1363,14 @@ bool TDB2::get (const std::string& uuid, Task& task)
|
|||
completed.get (uuid, task);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Locate task by UUID, wherever it is.
|
||||
bool TDB2::has (const std::string& uuid)
|
||||
{
|
||||
return pending.has (uuid) ||
|
||||
completed.has (uuid);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::vector <Task> TDB2::siblings (Task& task)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue